Commit Graph

515 Commits

Author SHA1 Message Date
Edward Loper
6b5b08e167 Internal change to build rules
PiperOrigin-RevId: 308727626
Change-Id: I9d092022d1068c314bc7671e43cb44f17534025c
2020-04-27 17:03:24 -07:00
Alexander Gorban
431c46b008 Change visibility rules.
PiperOrigin-RevId: 308158856
Change-Id: I561f618c6ee7975fc42ce8d7baef0a4bd2f46f87
2020-04-23 17:02:36 -07:00
Andrew Audibert
65e3fdb4ed [tf.data service] Package dataset ops that depend on grpc separately.
PiperOrigin-RevId: 306518696
Change-Id: I118f6599d93b149ae21f3eab63595008ded2692f
2020-04-14 14:51:55 -07:00
Terry Heo
4961f18733 Add embedded toolchains for cross-compiling
Added Bazel toolchain configuration for ARM's GNU toolchain.
- https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain
- GCC 8.3-2019.03

This configuration handles following CPU and build config_settings.
- armhf: linux_armhf
- aarch64: linux_aarch64

PiperOrigin-RevId: 306351085
Change-Id: I479d52e2243be9f75888ea81c7250e9072825da5
2020-04-13 18:27:07 -07:00
Derek Murray
7f09d08f5d [BUILD] Clean up unused aliases left over the "common_runtime/BUILD" split.
PiperOrigin-RevId: 304650362
Change-Id: Ifc27d8d87d7c7319462235f661668467494dd252
2020-04-03 11:07:56 -07:00
Oceania2018
a99f66ee34 Expose eager c_api_experimental to other language binding. 2020-03-21 10:48:38 -05:00
Gunhan Gulsoy
37dfcf6e2a [TF] Expose C API in libtensorflow_framework.
While at it, expose the associated header files from tensorflow/c/ in pip package.

Note, we expose the subset of C API that doesn't require tensorflow/cc linkage;
specifically the core operations that exclude building while loops and gradient ops,
and also excluding the experimental API.

The experimental API can also be added in the future, by factoring it into
"core" and "non-core" targets.  Similarly for the C eager API.

PiperOrigin-RevId: 301601988
Change-Id: I97eac79e684fc42ce90e67ee901cdcf6f7e91cbe
2020-03-18 09:17:46 -07:00
Eugene Brevdo
6e62523b64 [TF] Expose C API in libtensorflow_framework.
While at it, expose the associated header files from tensorflow/c/ in pip package.

Note, we expose the subset of C API that doesn't require tensorflow/cc linkage;
specifically the core operations that exclude building while loops and gradient ops,
and also excluding the experimental API.

The experimental API can also be added in the future, by factoring it into
"core" and "non-core" targets.  Similarly for the C eager API.

PiperOrigin-RevId: 301430667
Change-Id: I5ae7f3cedfe9dc72184d39ef1147193450c3d92e
2020-03-17 12:43:04 -07:00
A. Unique TensorFlower
f396035891 Upgrade and rename external dependency grpc in workspace for bazel.
Fixes 

Downstream projects depending on TensorFlow: If bazel complains, please substitute `@zlib_archive` with `@zlib`, and `@grpc` with `@com_github_grpc_grpc` in WORKPLACE.

PiperOrigin-RevId: 295824868
Change-Id: If2259d59e9d82543369e5670916b1398374c9889
2020-02-18 14:40:26 -08:00
Adrian Kuegel
27e92df581 Add visibility for bazel_pip prefixed packages.
This package prefix is used in open source Kokoro pip testing.
This fixes errors like this one:

target '//tensorflow/compiler/tests:xla_test' is not visible from target '//bazel_pip/tensorflow/compiler/tests:reshape_op_test_gpu'

PiperOrigin-RevId: 295754319
Change-Id: Id1d2f0c55df64a0505fa83db2961e06b33037323
2020-02-18 11:05:33 -08:00
A. Unique TensorFlower
16d4b320f0 More refactoring of the portable builds.
PiperOrigin-RevId: 294873040
Change-Id: Ic1805c0cbfa90e0351c3012a1af47583cd54341c
2020-02-13 03:01:28 -08:00
Anna R
5c00e793c6 Lazy load estimator instead of using virtual pip package. RFC: https://github.com/tensorflow/community/pull/182
PiperOrigin-RevId: 294847967
Change-Id: I327d075a2065e2ccf8ad5317882ebde14e3dc3d6
2020-02-12 23:53:18 -08:00
David Rees
881a8f04c0 XNNPACK does not build for Fuchsia, so do not include XNNPACK delegate provider when building benchmark_tflite_model_lib for Fuchsia.
PiperOrigin-RevId: 294558869
Change-Id: I3c8aad449bacf94d3ac4dc14507a349fa43d0d4c
2020-02-11 17:36:17 -08:00
Jose Baiocchi
7343cfb70a Cleanup profiler BUILD targets
PiperOrigin-RevId: 294292362
Change-Id: I14592dfb28ecc4801d5d9bfb4a4abd189b74c2ca
2020-02-10 13:42:28 -08:00
Jose Baiocchi
21bb9be2c1 Decouple ProfilerSession wrapper from pywrap_tfe
PiperOrigin-RevId: 293882403
Change-Id: I947e32807447460b6fc7ca1b19bf9ca276c3e994
2020-02-07 13:33:01 -08:00
Brian Zhao
1b58766589 Incrementally swap portions of tensorflow's build to rules_cc's version of cc build rules. This is part of the build refactoring described in https://github.com/tensorflow/community/pull/179
PiperOrigin-RevId: 290466858
Change-Id: I9b38b1b7f44f1defea9be6ffb9e5da0c5ca99fb5
2020-01-18 19:52:54 -08:00
Eugene Brevdo
9959c04433 [TF XLA] Add ability to convert SavedModel subgraphs to compiled [XLA CPU] objects via saved_model_cli.
You can now run, e.g.:

saved_model_cli aot_compile_cpu \
  --dir /path/to/saved_model \
  --tag_set serve \
  --signature_def_key action \
  --output_prefix /tmp/out \
  --cpp_class Serving::Action

Which will create the files:
  /tmp/{out.h, out.o, out_metadata.o, out_makefile.inc}

where out.h defines something like:

namespace Serving {
  class Action {
    ...
  }
}

and out_makefile.inc provides the additional flags required to include the header
and object files into your build.

You can optionally also point aot_compile_cpu to a newer set of checkpoints (weight values) by using the optional argument --checkpoint_path.

Also added `tf.test.is_built_with_xla()`.

TESTED:
* bazel test -c opt :saved_model_cli_test passes
* built and installed the pip wheel and tested in the bazel directory via:
  TEST_SRCDIR=/tmp/tfcompile/bazel-bin/tensorflow/python/tools/saved_model_cli_test.runfiles/ python saved_model_cli_test.py

and checking the output files to ensure the proper includes and header directories are
set in out_makefile.inc and out.h.

PiperOrigin-RevId: 290144104
Change-Id: If8eb6c3334b3042c4b9c24813b1b52c06d8fbc06
2020-01-16 14:26:12 -08:00
Smit Hinsu
b7f05ca3e4 Rolling forward the addition of build flag --experimental_cc_shared_library to tf/.bazelrc after patching the iOS build failure. This basically is e635ec06c6 with an additional patch to rules_swift. This change is part of the build refactoring described in https://github.com/tensorflow/community/pull/179
PiperOrigin-RevId: 289909322
Change-Id: I06f10d811f0ca598047e837acc0230afbf290e6f
2020-01-15 12:10:33 -08:00
Brian Zhao
e3668c51b1 Rolling forward the addition of build flag --experimental_cc_shared_library to tf/.bazelrc after patching the iOS build failure. This basically is e635ec06c6 with an additional patch to rules_swift. This change is part of the build refactoring described in https://github.com/tensorflow/community/pull/179
PiperOrigin-RevId: 289776116
Change-Id: I7f29e0e0b4447334a334ad888f464e12fbe29485
2020-01-14 18:54:54 -08:00
Brian Zhao
17ca256626 Automated g4 rollback of changelist 289161138.
PiperOrigin-RevId: 289177778
Change-Id: I1408822122a8c9cefd967f60b4e58bb767c03e96
2020-01-10 15:36:28 -08:00
Brian Zhao
e635ec06c6 Adding build flag --experimental_cc_shared_library to tf/.bazelrc, and moving existing usages of cc_library, cc_test, and cc_binary to rules_cc's version for a subset of the build known to be part of libtensorflow_framework. We will migrate further subdirectories of tf/core as we go along. This is part of Tensorflow's build refactoring, described in: https://github.com/tensorflow/community/pull/179
PiperOrigin-RevId: 289161138
Change-Id: Ic28a5b032a44315ea0528ad8c6737b36eb1d27a6
2020-01-10 14:06:58 -08:00
Anna R
8f7f1e22b4 Add _major_api_version to top level __init__.py file to tell when we import
tensorflow version 1 or version 2 api. + Minor change to the way root_init_template flag is passed in (now it should be a location path instead of file name).

PiperOrigin-RevId: 286729526
Change-Id: I55ebaa0cfe0fe3db3f4d1e699082b1f7b11df4da
2019-12-21 11:06:05 -08:00
Amit Patankar
50fae6026e Decouple ProfilerSession wrapper from pywrap_tfe
PiperOrigin-RevId: 286641101
Change-Id: Ic5046b977d1b42ed6a1e9038e3b6ec40a0a82e2f
2019-12-20 14:37:32 -08:00
Jose Baiocchi
df6698712a Decouple ProfilerSession wrapper from pywrap_tfe
PiperOrigin-RevId: 286609127
Change-Id: Ic70e27ad3820a2f1399dc414ded40bef811e5653
2019-12-20 11:15:12 -08:00
Brian Zhao
ead06270dc Adding tensorflow/core/platform/default/BUILD and tensorflow/core/platform/windows/BUILD.
This is part of the refactoring described in the Tensorflow Build Improvements RFC: https://github.com/tensorflow/community/pull/179
Subsequent changes will migrate targets from build_refactor.bzl into the new BUILD files.

PiperOrigin-RevId: 284712709
Change-Id: I650eb200ba0ea87e95b15263bad53b0243732ef5
2019-12-10 00:08:58 -08:00
A. Unique TensorFlower
b788566f37 Open source in the future TBD.
PiperOrigin-RevId: 284284241
Change-Id: Iaa5f96409e433f3c0e4523bf38b4a623f483009e
2019-12-06 16:46:08 -08:00
A. Unique TensorFlower
99b636a4c7 Add plumbing to allow for compiling for ChromeOS.
PiperOrigin-RevId: 283955023
Change-Id: I9fb819e7c1942feef1d0b42a4bd7d3911340fbde
2019-12-05 05:40:10 -08:00
A. Unique TensorFlower
654dc1e68c Internal change
PiperOrigin-RevId: 283397905
Change-Id: Idcd37af269be680c9ba3e56142aae5d58aea21f9
2019-12-02 13:41:35 -08:00
Brian Atkinson
b12e985cc8 Use redirection point in core/platform for build_config.bzl
PiperOrigin-RevId: 282458453
Change-Id: I55d997c870125aee7179e86cad664f7ecbe1e3a7
2019-11-25 16:38:05 -08:00
Brian Zhao
22b6510ed7 Automated g4 rollback of changelist 281607936.
PiperOrigin-RevId: 281660022
Change-Id: Ia51b2ac61d184a458444fd2fe08231fd4e071642
2019-11-20 19:54:06 -08:00
Brian Atkinson
0d74693dc8 Internal change
PiperOrigin-RevId: 281607936
Change-Id: Icea79d7bc4d98ff69fc1d20515ccddd9d20f7dbc
2019-11-20 16:21:23 -08:00
Brian Atkinson
98c671e864 Internal change
PiperOrigin-RevId: 281375332
Change-Id: I3c7efce7889b6b3129ad37a531e435ba46ad61b5
2019-11-19 16:40:26 -08:00
TensorFlower Gardener
98f0c14e83 Merge pull request from shawwn:patch-2
PiperOrigin-RevId: 281346128
Change-Id: I5fe13099be0806e9d69a410a64d996de89c41241
2019-11-19 14:16:21 -08:00
Brian Zhao
5caa9e8379 Fix for https://github.com/tensorflow/tensorflow/issues/34117
Bazel's change to legacy_whole_archive behavior is not the cause for TF's linking issues with protobuf. Protobuf's implementation and runtime are correctly being linked into TF here: da5765ebad/tensorflow/core/platform/default/build_config.bzl (L239) and da5765ebad/third_party/protobuf/protobuf.patch (L18), and I've confirmed that protobuf symbols are still present in libtensorflow_framework.so via nm.

After examining the linker flags that bazel passes to gcc, https://gist.github.com/bmzhao/f51bbdef50e9db9b24acd5b5acc95080, I discovered that the order of the linker flags was what was causing the undefined reference.

See https://eli.thegreenplace.net/2013/07/09/library-order-in-static-linking/ and https://stackoverflow.com/a/12272890. Basically linkers discard the objects they've been asked to link if those objects do not export any symbols that the linker currently has kept track as "undefined".

To prove this was the issue, I was able to successfully link after moving the linking shared object flag (-l:libtensorflow_framework.so.2) to the bottom of the flag order, and manually invoking g++.

This change uses cc_import to to link against a .so in the "deps" of tf_cc_binary, rather than as the "srcs" of tf_cc_binary. This technique was inspired by the comment here: 387c610d09/examples/windows/dll/windows_dll_library.bzl (L47-L48)

Successfully built on vanilla Ubuntu 18.04 VM:
bmzhao@bmzhao-tf-build-failure-reproing:~/tf-fix/tf$ bazel build -c opt --config=cuda --config=v2 --host_force_python=PY3 //tensorflow/tools/pip_package:build_pip_package
Target //tensorflow/tools/pip_package:build_pip_package up-to-date:
  bazel-bin/tensorflow/tools/pip_package/build_pip_package
INFO: Elapsed time: 2067.380s, Critical Path: 828.19s
INFO: 12942 processes: 51 remote cache hit, 12891 local.
INFO: Build completed successfully, 14877 total actions

The root cause might instead be https://github.com/bazelbuild/bazel/issues/7687, which is pending further investigation.

PiperOrigin-RevId: 281341817
Change-Id: Ia240eb050d9514ed5ac95b7b5fb7e0e98b7d1e83
2019-11-19 13:03:58 -08:00
Brian Atkinson
b39b1ed24b Require a dependency tree that fully resolves, through all select statements.
This should help prevent cases where things are committed to the codebase with
dangling references to things that don't exist.

PiperOrigin-RevId: 281200606
Change-Id: Ic298a1e051687099d9aa696cacb0dc2de062b600
2019-11-18 20:16:22 -08:00
Anna R
1821e90f31 Internal change
PiperOrigin-RevId: 279837487
Change-Id: Icb113453d85cdc347d8cae7e3da9c7be188156ae
2019-11-11 16:06:06 -08:00
William Chargin
8023e07367 Update comment for internal Copybara changes
PiperOrigin-RevId: 279535004
Change-Id: Id0d06fae83d5dae3c3281829557c0eae95108a8f
2019-11-09 15:58:40 -08:00
Anna R
bbe0cf60f9 Add compat.v1.compat.v2, compat.v1.compat.v1, compat.v2.compat.v2 modules to
simplify migration. Just importing compat.v2 and compat.v1 to create these modules would cause cycles. As a workaround, I add explicit __init__.py file under compat/vN/compat/vK and under compat/vN/compat/vK/compat modules.

PiperOrigin-RevId: 276154099
Change-Id: I3cae6f58759b63e9d1e9eb4ff18c59dcfff84b81
2019-10-22 15:21:27 -07:00
A. Unique TensorFlower
ba71f0ab61 Make TFLite GPU link against native GLES in Chrome OS.
PiperOrigin-RevId: 275523523
Change-Id: I7cadc58ae3084a0fef06afee5bac3cb544650d51
2019-10-18 12:32:21 -07:00
Chao Xie
06be240338 Set visibility of "api_version_2" Flag to be public.
PiperOrigin-RevId: 271374430
2019-09-26 10:18:33 -07:00
Scott Wegner
93a0fb7e51 Add bzl_library build target for various Skylark libraries.
PiperOrigin-RevId: 270958099
2019-09-24 12:32:28 -07:00
Gunhan Gulsoy
ffc25308ce [2.0] rm -rf tensorflow/contrib
PiperOrigin-RevId: 269816906
2019-09-18 09:05:58 -07:00
Gunhan Gulsoy
cb871fb2f7 Remove Apache ignite related code from main tensorflow repository.
This code has moved to github.com/tensorflow/io

PiperOrigin-RevId: 266467520
2019-08-30 15:36:36 -07:00
Gunhan Gulsoy
1e219a23c8 Remove kafka code from TF main repo.
This code has moved to github.com/tensorflow/io

PiperOrigin-RevId: 266212852
2019-08-29 14:04:02 -07:00
Gunhan Gulsoy
1b00dda2da Remove GDR code from main TF repo.
It has moved to github.com/tensorflow/networking

PiperOrigin-RevId: 266063354
2019-08-28 22:11:47 -07:00
Anna R
386da9758d Automated rollback of commit 1d1f7dfcbd
PiperOrigin-RevId: 266040561
2019-08-28 18:39:06 -07:00
Gunhan Gulsoy
25f08ffe5d Remove libverbs code from tensorflow/(contrib)
It has moved to github.com/tensorflow/networking

PiperOrigin-RevId: 266019701
2019-08-28 16:35:38 -07:00
Gunhan Gulsoy
35e5ec9e9e Remove MPI code from TF main repo, since it was moved to
github.com/tensorflow/networking.

PiperOrigin-RevId: 265974964
2019-08-28 13:22:55 -07:00
Anna R
1d1f7dfcbd Automated rollback of commit 1171258036
PiperOrigin-RevId: 265128581
2019-08-23 14:11:13 -07:00
A. Unique TensorFlower
e103b999be restrict profiler_util's visibility
PiperOrigin-RevId: 265075279
2019-08-23 10:08:07 -07:00