# runtime **Repository Path**: hilbert-wang/tensorflow_runtime ## Basic Information - **Project Name**: runtime - **Description**: https://github.com/tensorflow/runtime.git - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-04 - **Last Updated**: 2025-02-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # TFRT: A New TensorFlow Runtime TFRT is a new TensorFlow runtime. It aims to provide a unified, extensible infrastructure layer with best-in-class performance across a wide variety of domain specific hardware. It provides efficient use of multithreaded host CPUs, supports fully asynchronous programming models, and focuses on low-level efficiency. TFRT will benefit a broad range of users, but it will be of particular interest to you if you are a: * Researcher looking to experiment with complex new models and add custom operations to TensorFlow * Application developer looking for improved performance when serving models in production * Hardware maker looking to plug hardware into TensorFlow, including edge and datacenter devices ...or you are simply curious about cool ML infrastructure and low-level runtime technology! To learn more about TFRT’s early progress and wins, check out our [Tensorflow Dev Summit 2020 presentation](https://www.youtube.com/watch?v=15tiQoPpuZ8) where we provided a performance benchmark for small-batch GPU inference on ResNet 50, and our [MLIR Open Design Deep Dive presentation](https://drive.google.com/drive/folders/1fkLJuVP-tIk4GENBu2AgemF3oXYGr2PB) where we provided a detailed overview of TFRT’s core components, low-level abstractions, and general design principles. **Note:** TFRT is an early stage project and is not yet ready for general use. ## Getting started **TLDR:** This section describes how to set up a development environment for TFRT, as well as instructions to build and test TFRT components. TFRT currently supports Ubuntu-16.04. Future supported platforms include MacOS, Windows, etc. Bazel and clang are required to build and test TFRT. NVIDIA's CUDA Toolkit and cuDNN libraries are required for the GPU backend. To describe the TFRT build and test workflows, we will build and run the following binaries for graph execution. Recall from our Dev Summit presentation that for graph execution, a TensorFlow user passes into TFRT a TensorFlow graph created via high-level TensorFlow APIs, and TFRT then calls the [MLIR](https://www.tensorflow.org/mlir)-based graph compiler to optimize and lower the graph into [BEF](documents/binary_executable_format.md), a Binary Executable Format for TFRT graph execution (MLIR is the compiler infrastructure that we use to represent TFRT host programs). The blue arrows in the simplified TensorFlow training stack diagram below show this flow.
Top level directory | Sub-directory | Description |
include/
|
TFRT infrastructure public headers | |
lib/
|
TFRT infrastructure common for host runtime and all device runtime | |
basic_kernels/
|
Common infrastructure kernels, e.g. control flow kernels | |
bef_executor/
|
BEFFile and BEFExecutor implementation | |
bef_executor_driver/
|
Driver code for running BEFExecutor for an input MLIR file | |
bef_converter/
|
Converter between MLIR and BEF (bef_to_mlir and mlir_to_bef) | |
core_runtime/
|
TFRT Core Runtime infrastructure | |
distributed_runtime/
|
TFRT Distributed Runtime infrastructure | |
data/
|
TFRT infrastructure for TF input pipelines | |
host_context/
|
Host TFRT data structure, e.g. HostContext, AsyncValue, ConcurrentWorkQueue | |
metrics/
|
ML metric integration | |
support/
|
Basic utilities, e.g. hash_util, string_util | |
tensor/
|
Base Tensor class and host tensor implementations | |
test_kernels/
|
Testing kernel implementations | |
tracing/
|
Tracing/profiling support | |
cpp_tests/
|
C++ unit tests | |
mlir_tests/
|
MLIR-based unit tests | |
utils/
|
Miscellaneous utilities, such as scripts for generating test ML models. | |
tools/
|
Binaries including bef_executor, tfrt_translate etc. | |
backends/common/
|
Library shared for different backends, e.g. eigen, dnn_op_utils.h | |
ops/
|
Shared library for op implementations across devices, e.g. metadata functions | |
compat/eigen/
|
Adapter library for eigen, used by multiple backends | |
utils/
|
Miscellaneous utilities, such as scripts for generating MLIR test code. | |
backends/cpu/
|
CPU device infra and CPU ops and kernels | |
include/
|
CPU related public headers | |
lib/core_runtime/
|
CPU core_runtime infra, e.g. cpu_device | |
lib/ops
|
CPU ops | |
lib/kernels
|
CPU kernels | |
cpp_tests/
|
CPU infra unit tests | |
mlir_tests/
|
CPU mlir based tests | backends/gpu/
|
GPU infra and op/kernel implementations. We might split this directory into a separate repository at some point after the interface with the rest of TFRT infra becomes stable. |
include/
|
GPU related public headers | |
lib/core_runtime/
|
GPU Core runtime infra | |
lib/memory
|
GPU memory abstraction | |
lib/stream
|
GPU stream abstraction and wrappers | |
lib/tensor
|
GPU tensor | |
lib/ops
|
GPU ops | |
lib/kernels
|
GPU kernels | |
lib/data
|
GPU kernels for input pipeline infrastructure | |
cpp_tests/
|
GPU infra unit tests | |
mlir_tests/
|
GPU mlir based tests | |
tools/
|
Miscellaneous utilities |