Open-Source Wikis

/

TensorFlow

/

Reference

/

Dependencies

tensorflow/tensorflow

Dependencies

External libraries this repo pulls in. Two flavours: Python (pip) and C++ (Bazel/third_party/).

Python dependencies

Pip dependencies are pinned per supported Python version:

requirements_lock_3_10.txt
requirements_lock_3_11.txt
requirements_lock_3_12.txt
requirements_lock_3_13.txt
requirements_lock_3_14.txt

Each is ~70 KB and contains every transitive package with sha256 hashes. The list is regenerated by the Bazel rule //ci/official:requirements.

Notable runtime deps (subset; full list in the lockfile):

  • numpy — required pin per Python version.
  • absl-py — Google's absl/Python.
  • protobuf — runtime for the generated Python protos.
  • flatbuffers — runtime for the TFLite schema.
  • gast — used by AutoGraph for AST manipulation.
  • astunparse — AST → source.
  • wrapt — decorator helpers.
  • typing-extensions — backports.
  • ml_dtypes — bfloat16 and other ML-specific dtypes.
  • keras — Keras 3 (the standalone) is also a runtime dependency; it co-exists with the bundled v2 Keras snapshot in tensorflow/python/keras/.
  • tensorboard — only as an optional runtime dep; TensorBoard itself ships separately.
  • grpcio, grpcio-tools — gRPC bindings.

C++ / Bazel dependencies

Vendored under third_party/ and pulled in by Bazel rules in WORKSPACE/MODULE.bazel. Each vendored project usually has:

  • A WORKSPACE.bazel snippet that downloads the source tarball.
  • One or more *.BUILD files that override the upstream's build rules.
  • Optional patches to fit TF's build conventions.

Notable third-party libraries:

Project Where in third_party/ What for
Eigen third_party/eigen3/ Header-only linear-algebra; the CPU kernels' workhorse.
Abseil third_party/absl/ C++ utilities (status, strings, hash, time).
Protobuf third_party/protobuf/ Cross-process serialization.
gRPC (via bazel_deps) RPC.
MKL / oneDNN third_party/mkl_dnn/ Optimised CPU primitives on Intel.
ICU third_party/icu/ Unicode (TF strings).
NCCL third_party/nccl/ Multi-GPU collectives.
CUDA / cuDNN third_party/gpus/ GPU SDK glue.
TensorRT third_party/tensorrt/ NVIDIA inference accelerator.
NumPy headers third_party/py/ C-API wrappers.
FlatBuffers third_party/flatbuffers/ TFLite schema runtime.
ml_dtypes third_party/ml_dtypes/ bfloat16, float8, etc.
ruy third_party/ruy/ Optimised matmul library used by TFLite.
XNNPACK (referenced by TFLite xnnpack delegate) CPU SIMD acceleration for TFLite.
xla third_party/xla/ The XLA compiler (separated out to openxla/xla).
stablehlo third_party/stablehlo/ StableHLO MLIR dialect.
LLVM/MLIR third_party/llvm/ Pulled via bazel-deps; the compiler infra TF MLIR rides on.
Triton third_party/triton/ OpenAI's Triton GPU compiler (used by some XLA paths).
gast/astunparse (Python, via lockfile) AutoGraph backbone.

Run ls third_party/ to see the full list (~50 entries).

Update flow

  • Python: edit the requirements input and regenerate the lockfiles. Bot PRs from Dependabot land regularly (see by-the-numbers).
  • C++: typically a "version bump" PR that updates the URL/SHA in workspace2.bzl (or MODULE.bazel) and re-runs the patch sets in third_party/<name>/.

Why third_party/xla/ exists when XLA is a separate repo

XLA was extracted into openxla/xla in 2023 for governance reasons (multi-vendor). This repo still depends on it, and the Bazel rules in third_party/xla/ express that dependency. The same pattern is used for StableHLO (which has its own repo) and a few other former-internal modules.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Dependencies – TensorFlow wiki | Factory