Giter Site home page Giter Site logo

runtime's Introduction

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 where we provided a performance benchmark for small-batch GPU inference on ResNet 50, and our MLIR Open Design Deep Dive presentation 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-based graph compiler to optimize and lower the graph into BEF, 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.

TFRT Overview

The two binaries introduced next focus on the backend of the graph execution workflow. After the graph compiler has optimized the TensorFlow graph and produced a low-level TFRT Host Program represented in MLIR, tfrt_translate generates a BEF file from that host program and bef_executor runs the BEF file. The progression from TFRT Host Program to bef_executor via tfrt_translate is depicted in the expanded TensorFlow training stack diagram below. Note that the blue arrow between TFRT Host Program and BEF file represents tfrt_translate. Both programs are built in the tools directory.

BEF Conversion

tfrt_translate

The tfrt_translate program does round trip translation between MLIR and BEF, similar to an assembler and disassembler.

bef_executor

The bef_executor program is the execution driver of BEF files. It reads in a BEF file, sets up runtime, and asynchronously executes function(s) in that file.

Prerequisites

Install Bazel

To build TFRT, you need to install Bazel. TFRT is built and verified with Bazel 4.0. Follow the Bazel installation instructions to install Bazel. Verify the installation with

$ bazel --version
bazel 4.0.0

Install clang

Follow the clang installation instructions to install clang. The automatic installation script that installs clang, lldb, and lld, is recommended. TFRT is built and verified with clang 11.1.

If you have multiple versions of clang installed, ensure that the right version of clang is the default. On Ubuntu based systems, you can use update-alternatives to select the default version. The following example commands assume you installed clang-11:

$ sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-11 11
$ sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-11 11

Verify the installation with

$ clang --version
clang version 11.1.0

Install libstdc++

TFRT requires libstdc++8 or greater. Check clang's selected version with

$ clang++ -v |& grep "Selected GCC"
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/10

In the example above, the 10 at the end of the path indicates that clang will use libstdc++10, which is compatible with TFRT.

If you need to upgrade, the easiest way is to install gcc-8. Run the following command to install:

$ sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
$ sudo apt-get update
$ sudo apt-get install -y gcc-8 g++-8

To verify installation, re-run the clang++ -v check above.

GPU prerequisites

Note: You can skip this section if you don't want to build the GPU backend. Remember to exclude //backends/gpu/... from your Bazel target patterns though.

Building and running the GPU backend requires installing additional components.

Install clang Python bindings using pip with

$ pip install libclang

Install NVIDIA's CUDA Toolkit v11.2 (see installation guide for details) in a single directory from NVIDIA’s .run package with

$ wget http://developer.download.nvidia.com/compute/cuda/11.2.2/local_installers/cuda_11.2.2_460.32.03_linux.run
$ sudo sh cuda_11.2.2_460.32.03_linux.run --toolkit --installpath=<path>

Register the path to CUDA shared objects with

$ sudo echo '<path>/lib64' > '/etc/ld.so.conf.d/cuda.conf'
$ sudo ldconfig

Install NVIDIA's cuDNN libraries (see installation guide for details) with

$ wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn8_8.0.4.30-1+cuda11.1_amd64.deb
$ sudo apt install ./libcudnn8_8.0.4.30-1+cuda11.1_amd64.deb

Note: The above package is intended for CUDA 11.1, but is compatible with CUDA 11.2. TFRT is built and verified with cuDNN 8.1 for CUDA 11.2. Access to that package requires a (free) NVIDIA developer account.

Building and running TFRT

To build TFRT, cd to the root directory (where WORKSPACE file is located) of the TFRT workspace. A set of build configurations is in .bazelrc file. You can create a user.bazelrc in the repository root with extra Bazel configs that may be useful. Build tfrt_translate and bef_executor with the following commands:

$ bazel build //tools:bef_executor
$ bazel build //tools:tfrt_translate

The above commands build the binaries with opt compilation mode. Check Bazel's documentation for more build options. Bazel will notify the output location at the end of a successful build (default is bazel-bin).

After tfrt_translate and bef_executor are built, run an .mlir program with the following command:

$ bazel-bin/tools/tfrt_translate -mlir-to-bef path/to/program.mlir | bazel-bin/tools/bef_executor

TFRT provides a series of .mlir test programs. For example:

$ bazel-bin/tools/tfrt_translate -mlir-to-bef mlir_tests/bef_executor/async.mlir | bazel-bin/tools/bef_executor

Any output will be printed out to the terminal.

Adding GPU support

Add --config=cuda to the Bazel command to link the GPU backend to the above targets.

Custom CUDA Toolkit locations can be specified with --repo_env=CUDA_PATH=<path>. The default is /usr/local/cuda.

Testing

TFRT utilizes LLVM’s LIT infrastructure and FileCheck utility tool to construct MLIR-based check tests. These tests verify that some set of string tags appear in the test’s output. More introduction and guidelines on testing can be found here. An example test is shown below:

// RUN: tfrt_translate -mlir-to-bef %s | bef_executor | FileCheck %s
// RUN: tfrt_opt %s | tfrt_opt

// CHECK-LABEL: --- Running 'basic_tensor'
func @basic_tensor() {
  %c0 = tfrt.new.chain

  %a = dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]
  %c1 = dht.fill_tensor_with_constant.i32 %a, %c0 0 : i32

  // CHECK: shape = [3, 2], values = [0, 0, 0, 0, 0, 0]
  %c2 = dht.print_tensor %a, %c1

  tfrt.return
}

To run a test, simply invoke bazel test:

$ bazel test //mlir_tests/bef_executor:basics.mlir.test

Most tests under //backends/gpu/... need to be built with --config=cuda so that the GPU backend is linked to the bef_executor:

$ bazel test --config=cuda //backends/gpu/mlir_tests/core_runtime:get_device.mlir.test

Use Bazel target patterns to run multiple tests:

$ bazel test -- //... -//third_party/... -//backends/gpu/...  # All CPU tests.
$ bazel test --config=cuda //backends/gpu/...                 # All GPU tests.

Next Steps

Try our tutorial for some hands-on experience with TFRT.

See host runtime design for more details on TFRT's design.

Repository Overview

The three key directories under the TFRT root directory are

  • lib/: Contains core TFRT infrastructure code
  • backends/: Contains device specific infrastructure and op/kernel implementations
  • include/: Contains public header files for core TFRT infrastructure
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

Contribution guidelines

If you want to contribute to TFRT, be sure to review the contribution guidelines. This project adheres to TensorFlow's code of conduct. By participating, you are expected to uphold this code of conduct.

Note: TFRT is currently not open to contributions. TFRT developers are currently developing workflows and continuous integration for accepting contributions. Once we are ready, we will update this page.

Continuous build status

Status Status

Contact

Subscribe to the TFRT mailing list for general discussions about the runtime.

We use GitHub issues to track bugs and feature requests.

License

Apache License 2.0

runtime's People

Contributors

akuegel avatar alinas avatar bramandia avatar cantonios avatar cezheng avatar changhuilin avatar chsigg avatar chuanhaozhuge avatar cky9301 avatar d0k avatar durin42 avatar ezhulenev avatar fdxmw avatar gmngeoffrey avatar gribozavr avatar hanbinyoon avatar haoyuz avatar jing-dong avatar joker-eph avatar lindong28 avatar maskray avatar pifon2a avatar qqfish avatar rohitju avatar slackito avatar tlemo avatar tpopp avatar xldrx avatar zartoven avatar zhangqiaorjc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

runtime's Issues

build failed with missing header

Hi,
I'm recently tried to build TFRT by following the installation guide.
However, I found failure with errors after starting bazel build -c opt //tools:bef_executor, so I put the message I got with --verbose_failures flag.
It seems clang couldn't find some headers such as stdbuf.h. I think they are normally installed in /usr/include/linux/, /usr/lib/gcc/x86_64-linux-gnu/<your version>/include/. ofcourse you can manually install with libc++ or libclang-common-dev (but they are not one with libstdc++).
I'm not very sure using them is proper or not, is there anyone who knows about it??

I just in case pasted Dockerfile I used to build the env as well for some help.

root@22232bd2d0ae:/tfrt# bazel build -c opt //tools:bef_executor
WARNING: /root/.cache/bazel/_bazel_root/738a6075dc23ce42c0be9b4ee7a7a5da/external/zlib/BUILD.bazel:5:1: in includes attribute of cc_library rule @zlib//:zlib: ignoring invalid absolute path '/usr/lib/gcc/x86_64-linux-gnu/9/include'
INFO: Analyzed target //tools:bef_executor (29 packages loaded, 4054 targets configured).
INFO: Found 1 target...
ERROR: /root/.cache/bazel/_bazel_root/738a6075dc23ce42c0be9b4ee7a7a5da/external/zlib/BUILD.bazel:5:1: C++ compilation of rule '@zlib//:zlib' failed (Exit 1) clang failed: error executing command /usr/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 25 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
In file included from external/zlib/deflate.c:52:
In file included from external/zlib/deflate.h:16:
In file included from external/zlib/zutil.h:22:
In file included from external/zlib/zlib.h:34:
external/zlib/zconf.h:247:14: fatal error: 'stddef.h' file not found
#    include <stddef.h>
             ^~~~~~~~~~
1 error generated.
Target //tools:bef_executor failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 16.017s, Critical Path: 0.09s
INFO: 4 processes: 4 processwrapper-sandbox.
FAILED: Build did NOT complete successfully

The Dockerfile used to build the env.

FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu16.04

ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
ENV TZ=Asia/Tokyo

ARG workspace
ENV workspace /tfrt
WORKDIR $workspace

RUN echo $TZ > /etc/timezone && \
  apt-get update && apt-get install -y tzdata && \
  rm /etc/localtime && \
  ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
  dpkg-reconfigure -f noninteractive tzdata && \
  apt-get clean

RUN apt-get update --fix-missing && apt-get install -y \
  software-properties-common wget bzip2 git

RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test && \
  apt-get update && \
  apt-get install -y gcc-8 g++-8

RUN wget -q https://github.com/bazelbuild/bazelisk/releases/download/v0.0.8/bazelisk-linux-amd64 && \
  mv bazelisk-linux-amd64 /usr/local/bin/bazel && \
  chmod +x /usr/local/bin/bazel

RUN wget -q https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh && \
  chmod +x /tmp/llvm.sh && \
  /tmp/llvm.sh 9

RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 9 && \
  update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 9

rules_cuda example failed.

bazel run --cuda //examples:hello_cuda failed with the log below:

INFO: Build option --@rules_cuda//cuda:cuda_targets has changed, discarding analysis cache.
INFO: Analyzed target //examples:hello_cuda (20 packages loaded, 1579 targets configured).
INFO: Found 1 target...
Target //examples:hello_cuda up-to-date:
  bazel-bin/examples/hello_cuda
INFO: Elapsed time: 0.730s, Critical Path: 0.01s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
CUDA error: initialization error
CUDA error: initialization error

build error "error: use 'template' keyword to treat 'get' as a dependent template name"

I get the following error when I follow the build instructions

ERROR: /runtime/BUILD:613:1: C++ compilation of rule '//:data' failed (Exit 1) clang failed: error executing command /usr/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 56 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
In file included from lib/data/data_kernels.cc:22:
lib/data/filter_dataset.h:273:33: error: use 'template' keyword to treat 'get' as a dependent template name
} else if (predicate_value->get()) {
^
template
1 error generated.
Target //tools:bef_executor failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 97.526s, Critical Path: 19.24s
INFO: 370 processes: 370 linux-sandbox.
FAILED: Build did NOT complete successfully

A question about the tensor-related type system designed in tensor MLIR dialects of TFRT

Hi, I found that all the tensor-related parameters of op definitions are TensorType, regardless of the tensor's drvice type(on CUDA, CPU or TPU), sparse or not(COO or Dense).

In the following code snippets, all the ins tensors are delcared as TensorType, and it seems a general type representing Any tensor type.

def TensorPrintOp : CUDA_Op<"tensor.print_metadata"> {
let summary = "cuda tensor.print_metadata operation";
let description = [{
tfrt_cuda.tensor.print prints a CUDA tensor metadata
Example:
%ch1 = tfrt.new.chain
%ch2 = tfrt_cuda.tensor.print_metadata %tensor, %ch1
}];
let arguments = (ins TensorType, TFRT_ChainType);
let results = (outs TFRT_ChainType);
}

class ConvertToDHTOp<string dtype, int rank>
: COO_Op<"convert_coo_to_dht." # dtype # "." # rank> {
let summary = "coo.convert_coo_to_dht operation";
let description = [{
Convert a sparse tensor to a dense host tensor.
It takes a sparse tensor and chain as input and outputs dht tensor and
chain.
Example:
%4, %3 = coo.convert_coo_to_dht.i32.0 %1, %0
%5, %6 = coo.convert_coo_to_dht.i32.2 %2, %0
}];
let arguments = (ins TensorType, TFRT_ChainType);
let results = (outs TensorType, TFRT_ChainType);
let assemblyFormat = "operands attr-dict";
}

class FillTensorOp<string dtype>
: DHT_Op<"fill_tensor_with_constant." # dtype> {
let summary = "tfrt_dht.fill_tensor_with_constant operation";
let description = [{
An operation that fills an input tensor with a value. It takes an input
tensor and a chain as inputs and a constant value attribute, and outputs a
chain.
Example:
%1 = tfrt.new.chain
%2 = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i32, 2 : i32]
%3 = tfrt_dht.fill_tensor_with_constant.i32 %2, %1 0 : i32
}];
let arguments = (ins TensorType, TFRT_ChainType);
let results = (outs TFRT_ChainType);

I wonder how TFRT's mlir logic detect the type conflicts when mix using these dialects, for example

// create a dense tensor
%a = tfrt_dht.create_uninitialized_tensor.i32.2 [3 : i64, 2 : i64]
// convert a COO tennsor to dense, but the input %a is a dense tensor, broken here
%b, %ch1 = coo.convert_coo_to_dht.i32.0 %a, %ch0

It seems that, the TensorType in Op definition makes the parameters' type vague, and one can't tell whether a input/output locate on GPU or CPU, or it is a COO Tensor or a Dense Tensor and might write/generate buggy mlir program.

I wonder how TFRT solve above issue?

Build failure with unknown error

Hi,
I'm recently tried to build TFRT by following the installation guide.
However, I found failure with errors after starting bazel build -c opt //tools:bef_executor, so I put the message I got with --verbose_failures flag.
I couldn't solve this error, it might be related to the clang binary tiself??
Is there anyone who knows about it??

I just in case pasted Dockerfile I used to build the env as well for some help.

root@2aa5b6b7e857:/tfrt# bazel build -c opt //tools:bef_executor --verbose_failures
WARNING: /root/.cache/bazel/_bazel_root/738a6075dc23ce42c0be9b4ee7a7a5da/external/zlib/BUILD.bazel:5:1: in includes attribute of cc_library rule @zlib//:zlib: ignoring invalid absolute path '/usr/lib/gcc/x86_64-linux-gnu/9/include'
INFO: Analyzed target //tools:bef_executor (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /tfrt/BUILD:236:1: C++ compilation of rule '//:basic_kernels' failed (Exit 254): clang failed: error executing command 
  (cd /root/.cache/bazel/_bazel_root/738a6075dc23ce42c0be9b4ee7a7a5da/sandbox/processwrapper-sandbox/86/execroot/tf_runtime && \
  exec env - \
    LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64 \
    PATH=/root/.vscode-server/bin/ff915844119ce9485abfe8aa9076ec76b5300ddd/bin:/opt/conda/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
    PWD=/proc/self/cwd \
  /usr/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/k8-opt/bin/_objs/basic_kernels/contr
ol_flow_kernels.d '-frandom-seed=bazel-out/k8-opt/bin/_objs/basic_kernels/control_flow_kernels.o' -DLLVM_ENABLE_STATS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DLLVM_BUILD_GLOBAL_ISEL -iquote . -iquote bazel-out/k8-opt/bin -iquote external/llvm-p
roject -iquote bazel-out/k8-opt/bin/external/llvm-project -iquote external/zlib -iquote bazel-out/k8-opt/bin/external/zlib -isystem include -isystem bazel-out/k8-opt/bin/include -isystem external/llvm-project/llvm/include -isystem bazel-out/k8-opt/bin/external/llvm-project/l
lvm/include -isystem external/zlib -isystem bazel-out/k8-opt/bin/external/zlib -isystem third_party/llvm_derived/include -isystem bazel-out/k8-opt/bin/third_party/llvm_derived/include -Wc++14-compat -Wno-unused-local-typedef '-std=c++14' -Wno-c++98-c++11-compat -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c lib/basic_kernels/control_flow_kernels.cc -o bazel-out/k8-opt/bin/_objs/basic_kernels/control_flow_kernels.o)
Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox clang failed: error executing command 
  (cd /root/.cache/bazel/_bazel_root/738a6075dc23ce42c0be9b4ee7a7a5da/sandbox/processwrapper-sandbox/86/execroot/tf_runtime && \
  exec env - \
    LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64 \
    PATH=/root/.vscode-server/bin/ff915844119ce9485abfe8aa9076ec76b5300ddd/bin:/opt/conda/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
    PWD=/proc/self/cwd \
  /usr/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/k8-opt/bin/_objs/basic_kernels/control_flow_kernels.d '-frandom-seed=bazel-out/k8-opt/bin/_objs/basic_kernels/control_flow_kernels.o' -DLLVM_ENABLE_STATS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DLLVM_BUILD_GLOBAL_ISEL -iquote . -iquote bazel-out/k8-opt/bin -iquote external/llvm-project -iquote bazel-out/k8-opt/bin/external/llvm-project -iquote external/zlib -iquote bazel-out/k8-opt/bin/external/zlib -isystem include -isystem bazel-out/k8-opt/bin/include -isystem external/llvm-project/llvm/include -isystem bazel-out/k8-opt/bin/external/llvm-project/llvm/include -isystem external/zlib -isystem bazel-out/k8-opt/bin/external/zlib -isystem third_party/llvm_derived/include -isystem bazel-out/k8-opt/bin/third_party/llvm_derived/include -Wc++14-compat -Wno-unused-local-typedef '-std=c++14' -Wno-c++98-c++11-compat -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c lib/basic_kernels/control_flow_kernels.cc -o bazel-out/k8-opt/bin/_objs/basic_kernels/control_flow_kernels.o)
Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox
Stack dump:
0.      Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name control_flow_kernels.cc -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose 
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -ffunction-sections -fdata-sections -coverage-notes-file /proc/self/cwd/bazel-out/k8-opt/bin/_objs/basic_kernels/control_flow_kernels.g
cno -resource-dir /usr/lib/clang/8.0.0 -dependency-file bazel-out/k8-opt/bin/_objs/basic_kernels/control_flow_kernels.d -MT bazel-out/k8-opt/bin/_objs/basic_kernels/control_flow_kernels.o -sys-header-deps -iquote . -iquote bazel-out/k8-opt/bin -iquote external/llvm-project -
iquote bazel-out/k8-opt/bin/external/llvm-project -iquote external/zlib -iquote bazel-out/k8-opt/bin/external/zlib -isystem include -isystem bazel-out/k8-opt/bin/include -isystem external/llvm-project/llvm/include -isystem bazel-out/k8-opt/bin/external/llvm-project/llvm/incl
ude -isystem external/zlib -isystem bazel-out/k8-opt/bin/external/zlib -isystem third_party/llvm_derived/include -isystem bazel-out/k8-opt/bin/third_party/llvm_derived/include -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=1 -D NDEBUG -D LLVM_ENABLE_STATS -D __STDC_LIMIT_MACROS -D __
STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D LLVM_BUILD_GLOBAL_ISEL -D __DATE__="redacted" -D __TIMESTAMP__="redacted" -D __TIME__="redacted" -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-li
nux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward -internal-isystem /usr/include
/clang/8.0.0/include/ -internal-isystem /usr/local/include -internal-isystem /usr/lib/clang/8.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wall -Wthread-safety -Wself-assign -Wc++14-compat -Wno-unused-local-typedef -Wno-c++98-c++11-compat -Wno-builtin-macro-redefined -std=c++14 -fdeprecated-macro -fdebug-compilation-dir /proc/self/cwd -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o bazel-out/k8-opt/bin/_objs/basic_kernels/control_flow_kernels.o -x c++ lib/basic_kernels/control_flow_kernels.cc -faddrsig 
1.      <eof> parser at end of file
2.      include/tfrt/host_context/kernel_utils.h:417:15: instantiating function definition 'tfrt::TfrtKernelImpl<tfrt::Chain (*)(), &tfrt::HexNewChain>::Invoke'
3.      include/tfrt/host_context/kernel_utils.h:945:17: instantiating function definition 'tfrt::TfrtKernelImpl<tfrt::Chain (*)(), &tfrt::HexNewChain>::SyncKernelCallHelper<>::Invoke<0, 0, 0, false, false>'
/usr/lib/x86_64-linux-gnu/libLLVM-8.so.1(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x1f)[0x7f7f0a73c7bf]
/usr/lib/x86_64-linux-gnu/libLLVM-8.so.1(_ZN4llvm3sys17RunSignalHandlersEv+0x50)[0x7f7f0a73ac10]
/usr/lib/x86_64-linux-gnu/libLLVM-8.so.1(+0x96fbc8)[0x7f7f0a73cbc8]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f7f0d9ed390]
/usr/bin/clang(_ZNK5clang10ASTContext28getSubstTemplateTypeParmTypeEPKNS_20TemplateTypeParmTypeENS_8QualTypeE+0x99)[0x189f239]
/usr/bin/clang[0x175b47f]
/usr/bin/clang[0x175a3a2]
/usr/bin/clang[0x1773206]
/usr/bin/clang[0x1772197]
/usr/bin/clang[0x177151e]
/usr/bin/clang[0x17669e0]
/usr/bin/clang[0x1774102]
/usr/bin/clang[0x176b6c0]
/usr/bin/clang[0x1764b3e]
/usr/bin/clang[0x17766b6]
/usr/bin/clang(_ZN5clang4Sema9SubstStmtEPNS_4StmtERKNS_30MultiLevelTemplateArgumentListE+0x3f)[0x1764aef]
/usr/bin/clang(_ZN5clang4Sema29InstantiateFunctionDefinitionENS_14SourceLocationEPNS_12FunctionDeclEbbb+0xccf)[0x1792b8f]
/usr/bin/clang(_ZN5clang4Sema28PerformPendingInstantiationsEb+0x1bf)[0x179532f]
/usr/bin/clang(_ZN5clang4Sema29InstantiateFunctionDefinitionENS_14SourceLocationEPNS_12FunctionDeclEbbb+0xe3c)[0x1792cfc]
/usr/bin/clang(_ZN5clang4Sema28PerformPendingInstantiationsEb+0x1bf)[0x179532f]
/usr/bin/clang(_ZN5clang4Sema25ActOnEndOfTranslationUnitEv+0x1f6)[0x129b936]
/usr/bin/clang(_ZN5clang6Parser17ParseTopLevelDeclERNS_9OpaquePtrINS_12DeclGroupRefEEE+0x342)[0x11ceaf2]
/usr/bin/clang(_ZN5clang8ParseASTERNS_4SemaEbb+0x1c6)[0x11ca426]
/usr/bin/clang(_ZN5clang14FrontendAction7ExecuteEv+0x3f)[0xad9c2f]
/usr/bin/clang(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x548)[0xa9ac18]
/usr/bin/clang(_ZN5clang25ExecuteCompilerInvocationEPNS_16CompilerInstanceE+0x636)[0xb5e1d6]
/usr/bin/clang(_Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x54c)[0x6a0d8c]
/usr/bin/clang(main+0x263a)[0x69f42a]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f7f0911f830]
/usr/bin/clang(_start+0x29)[0x69cb29]
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 8.0.0-3~ubuntu16.04.1 (tags/RELEASE_800/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/control_flow_kernels-fe0f07.cpp
clang: note: diagnostic msg: /tmp/control_flow_kernels-fe0f07.sh
clang: note: diagnostic msg: 

********************
Target //tools:bef_executor failed to build
INFO: Elapsed time: 1.083s, Critical Path: 0.91s
INFO: 3 processes: 3 processwrapper-sandbox.
FAILED: Build did NOT complete successfully

The Dockerfile used to build the env.

FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu16.04

ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
ENV TZ=Asia/Tokyo

ARG workspace
ENV workspace /tfrt
WORKDIR $workspace

RUN echo $TZ > /etc/timezone && \
  apt-get update && apt-get install -y tzdata && \
  rm /etc/localtime && \
  ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
  dpkg-reconfigure -f noninteractive tzdata && \
  apt-get clean

RUN apt-get update --fix-missing && apt-get install -y \
  software-properties-common wget bzip2 git

RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test && \
  apt-get update && \
  apt-get install -y gcc-8 g++-8 llvm-8 clang-8 lldb-8 lld-8

RUN wget -q https://github.com/bazelbuild/bazelisk/releases/download/v0.0.8/bazelisk-linux-amd64 && \
  mv bazelisk-linux-amd64 /usr/local/bin/bazel && \
  chmod +x /usr/local/bin/bazel

RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 8 && \
  update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 8

can't compile bef_executor in debug mode for GPU

when doing:

bazel build --config=cuda -c dbg //tools:bef_executor
using clang-10 as the underlying compiler, it errors out with:

ERROR: /home/baarts/tensorflow/runtime/tools/BUILD:106:1: Linking of rule '//tools:bef_executor' failed (Exit 1)
third_party/concurrent_work_queue/lib/task_queue.h:0: error: undefined reference to 'tfrt::internal::TaskQueue::kCapacity'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Target //tools:bef_executor failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 307.380s, Critical Path: 141.03s
INFO: 870 processes: 870 local.
FAILED: Build did NOT complete successfully
root@a23601beb844:/home/baarts/tensorflow/runtime#

kCapacity is a static data member that doesn't have an out of class definition. This is required for C++ <= 14.
Since this is a headerfile only class definition, there's no obvious location to put the defintion.
Using c++17 instead of c++14 (in .bazelrc) makes the compilation succeed.

Please update GPU support build instructions

The current instructions recommend Clang 9 + CUDA 10.2. Unfortunately, Clang 9 only supports CUDA versions up to 10.1.

  • Clang 10 (mostly?) works with CUDA 10.2 (although not with CUDA 11.x+).
  • Clang 9 + CUDA 10.1 should be working fine

The compatibility matrix is arguably frustrating, but for those who want to build with Clang (as opposed to GCC + NVCC) it would be helpful if the build instructions mention at least a combination known to work.

Build on MacOS

I tried to make runtime build work on MacOS. bazel build -c opt //tools:tfrt_translate completed successfully, but bazel build -c opt //tools:bef_executor failed with the following error:

INFO: Analyzed target //tools:bef_executor (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /Users/feihu/Documents/GitHub/runtime/tools/BUILD:86:1: Linking of rule '//tools:bef_executor' failed (Exit 1): cc_wrapper.sh failed: error executing command 
  (cd /private/var/tmp/_bazel_feihu/049199822dda0c989ae40a6b0d7df7c6/sandbox/darwin-sandbox/2572/execroot/tf_runtime && \
  exec env - \
    APPLE_SDK_PLATFORM=MacOSX \
    APPLE_SDK_VERSION_OVERRIDE=10.15 \
    PATH=/Users/feihu/python-env/tensorflow/bin:/usr/local/Cellar/llvm/10.0.0_3/bin/:/usr/local/Cellar/gcc/9.3.0_1/bin/:/Users/feihu/miniconda3/bin:/Users/feihu/miniconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/Users/feihu/bin:./node_modules/.bin \
    XCODE_VERSION_OVERRIDE=11.4.1.11E503a \
  external/local_config_cc/cc_wrapper.sh -lc++ -fobjc-link-runtime -o bazel-out/darwin-opt/bin/tools/bef_executor -Wl,-force_load,bazel-out/darwin-opt/bin/libbasic_kernels_alwayslink.lo bazel-out/darwin-opt/bin/libbasic_kernels.a bazel-out/darwin-opt/bin/tools/libbef_executor_lib.a bazel-out/darwin-opt/bin/libbef_executor_driver.a bazel-out/darwin-opt/bin/libbefexecutor.a bazel-out/darwin-opt/bin/libmetrics_api.a bazel-out/darwin-opt/bin/external/llvm-project/mlir/libIR.a -Wl,-force_load,bazel-out/darwin-opt/bin/libhostcontext_alwayslink.lo -Wl,-force_load,bazel-out/darwin-opt/bin/libcore_runtime_alwayslink.lo -Wl,-force_load,bazel-out/darwin-opt/bin/libdata_alwayslink.lo bazel-out/darwin-opt/bin/libdata.a -Wl,-force_load,bazel-out/darwin-opt/bin/libsimple_tracing_sink_alwayslink.lo bazel-out/darwin-opt/bin/libsimple_tracing_sink.a -Wl,-force_load,bazel-out/darwin-opt/bin/libtensor_alwayslink.lo -Wl,-force_load,bazel-out/darwin-opt/bin/libtest_kernels_alwayslink.lo bazel-out/darwin-opt/bin/libtest_kernels.a -Wl,-force_load,bazel-out/darwin-opt/bin/backends/common/libeigen_kernels_alwayslink.lo -Wl,-force_load,bazel-out/darwin-opt/bin/backends/cpu/libcore_runtime_alwayslink.lo -Wl,-force_load,bazel-out/darwin-opt/bin/backends/cpu/libtest_ops_alwayslink.lo bazel-out/darwin-opt/bin/backends/cpu/libtest_ops.a bazel-out/darwin-opt/bin/backends/common/libtest_metadata_functions.a -Wl,-force_load,bazel-out/darwin-opt/bin/backends/cpu/libtf_ops_alwayslink.lo bazel-out/darwin-opt/bin/backends/cpu/libtf_ops.a bazel-out/darwin-opt/bin/backends/cpu/libcore_runtime.a bazel-out/darwin-opt/bin/backends/common/libtf_metadata_functions.a bazel-out/darwin-opt/bin/backends/common/libtf_dnn_ops_util.a bazel-out/darwin-opt/bin/backends/common/libeigen_kernels.a bazel-out/darwin-opt/bin/backends/common/libeigencompat.a bazel-out/darwin-opt/bin/external/mkl_dnn/libmkldnn_single_threaded.a bazel-out/darwin-opt/bin/libcore_runtime.a bazel-out/darwin-opt/bin/libtracing.a bazel-out/darwin-opt/bin/libtensor.a bazel-out/darwin-opt/bin/libhostcontext.a bazel-out/darwin-opt/bin/libsupport.a bazel-out/darwin-opt/bin/third_party/llvm_derived/libostream.a bazel-out/darwin-opt/bin/external/llvm-project/mlir/libSupport.a bazel-out/darwin-opt/bin/external/llvm-project/llvm/libsupport.a bazel-out/darwin-opt/bin/external/llvm-project/llvm/libdemangle.a bazel-out/darwin-opt/bin/external/zlib/libzlib.a -headerpad_max_install_names -pthread -ldl -lm -no-canonical-prefixes '-mmacosx-version-min=10.15')
Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox cc_wrapper.sh failed: error executing command 
  (cd /private/var/tmp/_bazel_feihu/049199822dda0c989ae40a6b0d7df7c6/sandbox/darwin-sandbox/2572/execroot/tf_runtime && \
  exec env - \
    APPLE_SDK_PLATFORM=MacOSX \
    APPLE_SDK_VERSION_OVERRIDE=10.15 \
    PATH=/Users/feihu/python-env/tensorflow/bin:/usr/local/Cellar/llvm/10.0.0_3/bin/:/usr/local/Cellar/gcc/9.3.0_1/bin/:/Users/feihu/miniconda3/bin:/Users/feihu/miniconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/Users/feihu/bin:./node_modules/.bin \
    XCODE_VERSION_OVERRIDE=11.4.1.11E503a \
  external/local_config_cc/cc_wrapper.sh -lc++ -fobjc-link-runtime -o bazel-out/darwin-opt/bin/tools/bef_executor -Wl,-force_load,bazel-out/darwin-opt/bin/libbasic_kernels_alwayslink.lo bazel-out/darwin-opt/bin/libbasic_kernels.a bazel-out/darwin-opt/bin/tools/libbef_executor_lib.a bazel-out/darwin-opt/bin/libbef_executor_driver.a bazel-out/darwin-opt/bin/libbefexecutor.a bazel-out/darwin-opt/bin/libmetrics_api.a bazel-out/darwin-opt/bin/external/llvm-project/mlir/libIR.a -Wl,-force_load,bazel-out/darwin-opt/bin/libhostcontext_alwayslink.lo -Wl,-force_load,bazel-out/darwin-opt/bin/libcore_runtime_alwayslink.lo -Wl,-force_load,bazel-out/darwin-opt/bin/libdata_alwayslink.lo bazel-out/darwin-opt/bin/libdata.a -Wl,-force_load,bazel-out/darwin-opt/bin/libsimple_tracing_sink_alwayslink.lo bazel-out/darwin-opt/bin/libsimple_tracing_sink.a -Wl,-force_load,bazel-out/darwin-opt/bin/libtensor_alwayslink.lo -Wl,-force_load,bazel-out/darwin-opt/bin/libtest_kernels_alwayslink.lo bazel-out/darwin-opt/bin/libtest_kernels.a -Wl,-force_load,bazel-out/darwin-opt/bin/backends/common/libeigen_kernels_alwayslink.lo -Wl,-force_load,bazel-out/darwin-opt/bin/backends/cpu/libcore_runtime_alwayslink.lo -Wl,-force_load,bazel-out/darwin-opt/bin/backends/cpu/libtest_ops_alwayslink.lo bazel-out/darwin-opt/bin/backends/cpu/libtest_ops.a bazel-out/darwin-opt/bin/backends/common/libtest_metadata_functions.a -Wl,-force_load,bazel-out/darwin-opt/bin/backends/cpu/libtf_ops_alwayslink.lo bazel-out/darwin-opt/bin/backends/cpu/libtf_ops.a bazel-out/darwin-opt/bin/backends/cpu/libcore_runtime.a bazel-out/darwin-opt/bin/backends/common/libtf_metadata_functions.a bazel-out/darwin-opt/bin/backends/common/libtf_dnn_ops_util.a bazel-out/darwin-opt/bin/backends/common/libeigen_kernels.a bazel-out/darwin-opt/bin/backends/common/libeigencompat.a bazel-out/darwin-opt/bin/external/mkl_dnn/libmkldnn_single_threaded.a bazel-out/darwin-opt/bin/libcore_runtime.a bazel-out/darwin-opt/bin/libtracing.a bazel-out/darwin-opt/bin/libtensor.a bazel-out/darwin-opt/bin/libhostcontext.a bazel-out/darwin-opt/bin/libsupport.a bazel-out/darwin-opt/bin/third_party/llvm_derived/libostream.a bazel-out/darwin-opt/bin/external/llvm-project/mlir/libSupport.a bazel-out/darwin-opt/bin/external/llvm-project/llvm/libsupport.a bazel-out/darwin-opt/bin/external/llvm-project/llvm/libdemangle.a bazel-out/darwin-opt/bin/external/zlib/libzlib.a -headerpad_max_install_names -pthread -ldl -lm -no-canonical-prefixes '-mmacosx-version-min=10.15')
Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox
Undefined symbols for architecture x86_64:
  "tfrt::OpAttrType tfrt::GetOpAttrType<long>()", referenced from:
      tfrt::MetadataFnImpl<llvm::Expected<tfrt::TensorMetadata> (*)(tfrt::TensorMetadata const&, tfrt::TensorMetadata const&, tfrt::OpAttrsRef const&), &(tfrt::TfConvOpMd(tfrt::TensorMetadata const&, tfrt::TensorMetadata const&, tfrt::OpAttrsRef const&))>::Invoke(tfrt::ExecutionContext const&, llvm::ArrayRef<tfrt::TensorMetadata>, tfrt::OpAttrsRef const&, llvm::MutableArrayRef<tfrt::TensorMetadata>) in libtf_metadata_functions.a(metadata_functions_07e51e054eb6b4d322b1a31b487edf2d.o)
      tfrt::MetadataFnImpl<llvm::Expected<tfrt::TensorMetadata> (*)(tfrt::TensorMetadata const&, tfrt::OpAttrsRef const&), &(tfrt::TfMaxPoolOpMd(tfrt::TensorMetadata const&, tfrt::OpAttrsRef const&))>::Invoke(tfrt::ExecutionContext const&, llvm::ArrayRef<tfrt::TensorMetadata>, tfrt::OpAttrsRef const&, llvm::MutableArrayRef<tfrt::TensorMetadata>) in libtf_metadata_functions.a(metadata_functions_07e51e054eb6b4d322b1a31b487edf2d.o)
      tfrt::MetadataFnImpl<llvm::Expected<tfrt::TensorMetadata> (*)(tfrt::OpAttrsRef const&), &(tfrt::CreateFromScalarMD(tfrt::OpAttrsRef const&))>::Invoke(tfrt::ExecutionContext const&, llvm::ArrayRef<tfrt::TensorMetadata>, tfrt::OpAttrsRef const&, llvm::MutableArrayRef<tfrt::TensorMetadata>) in libtest_metadata_functions.a(test_ops_6eeba64ad03c479f6c4e94bde85f3ffc.o)
      tfrt::MetadataFnImpl<llvm::Expected<tfrt::TensorMetadata> (*)(tfrt::TensorMetadata const&, tfrt::OpAttrsRef const&), &(tfrt::BroadcastMD(tfrt::TensorMetadata const&, tfrt::OpAttrsRef const&))>::Invoke(tfrt::ExecutionContext const&, llvm::ArrayRef<tfrt::TensorMetadata>, tfrt::OpAttrsRef const&, llvm::MutableArrayRef<tfrt::TensorMetadata>) in libtest_metadata_functions.a(test_ops_6eeba64ad03c479f6c4e94bde85f3ffc.o)
      tfrt::MetadataFnImpl<llvm::Expected<tfrt::TensorMetadata> (*)(tfrt::OpAttrsRef const&), &(tfrt::CreateDenseTensorMD(tfrt::OpAttrsRef const&))>::Invoke(tfrt::ExecutionContext const&, llvm::ArrayRef<tfrt::TensorMetadata>, tfrt::OpAttrsRef const&, llvm::MutableArrayRef<tfrt::TensorMetadata>) in libtest_metadata_functions.a(test_ops_6eeba64ad03c479f6c4e94bde85f3ffc.o)
      tfrt::MetadataFnImpl<llvm::Expected<tfrt::TensorMetadata> (*)(tfrt::TensorMetadata const&, tfrt::TensorMetadata const&, tfrt::OpAttrsRef const&), &(tfrt::CreateCooTensorMD(tfrt::TensorMetadata const&, tfrt::TensorMetadata const&, tfrt::OpAttrsRef const&))>::Invoke(tfrt::ExecutionContext const&, llvm::ArrayRef<tfrt::TensorMetadata>, tfrt::OpAttrsRef const&, llvm::MutableArrayRef<tfrt::TensorMetadata>) in libtest_metadata_functions.a(test_ops_6eeba64ad03c479f6c4e94bde85f3ffc.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Target //tools:bef_executor failed to build
INFO: Elapsed time: 1.278s, Critical Path: 0.65s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

Two changes are added to the code to fix the incompatibility between int64_t and ssize_t on MacOS:

  1. attribute_utils.h#L324: reinterpret_cast<const int64_t*>(bytes + header.shape_offset) -> reinterpret_cast<const ssize_t*>(bytes + header.shape_offset)

  2. kernels.cc#L146: TensorMetadata metadata(DType(DType::String), shape.GetValue<int64_t>()); -> TensorMetadata metadata(DType(DType::String), shape.GetValue<ssize_t>());;

I'm not sure if the error is related to the above code changes. Any suggestions/comments are appreciated!

Debug build failure with GCC + NVCC

When building the debug bits with GCC + NVCC

external/local_cuda/cuda/include/crt/host_runtime.h:264: error: undefined reference to '__cudaInitModule'
external/local_cuda/cuda/include/crt/host_runtime.h:264: error: undefined reference to '__cudaInitModule'
external/local_cuda/cuda/include/crt/host_runtime.h:264: error: undefined reference to '__cudaInitModule'
external/local_cuda/cuda/include/crt/host_runtime.h:264: error: undefined reference to '__cudaInitModule'
collect2: error: ld returned 1 exit status
Target //tools:bef_executor failed to build

This is the same issue as tensorflow/tensorflow#39280 and the fix is trivial: add __cudaInitModule to cudart_stub.cc

Please make it easier to build with clang + nvcc

While it's already possible to build with clang + nvcc (by hacking .bazelrc for example), this combination is not documented and the ergonomics could be improved.

Using clang + nvcc makes it easier to use the latest CUDA SDKs w/o having to switch to GCC.

[rules_cuda] Broken link of rules_cc

WARNING: Download from https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/40548a2974f1aea06215272d9c2b47a14a24e556.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found

I tried to manually open https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/40548a2974f1aea06215272d9c2b47a14a24e556.tar.gz but got:

<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
</Error>

Include Header file from .so library

Hi, I am trying to include the headers from .so library but not sure about the include paths.
For example:
I have a .so filie compiled by several headers files.
Then I added the code below in the HEAD

cc_import(
name = "test_so",
shared_library = "include/tfrt/test.so",
visibility = [":friends"],
)

tfrt_cc_library(
name = "test_headers",
srcs = ["test_headers.cc",],
deps = ["@tf_runtime//test_so"],
)
What's the path of headers in test.so should I include in the test_headers.cc?
Thanks

rules_cuda example fails to run

When I run bazel run --cuda //examples:hello_cuda, it fails with the following error

gcc-8: error: unrecognized command line option '-Wthread-safety'; did you mean '-fthread-jumps'?
gcc-8: error: unrecognized command line option '-Wself-assign'; did you mean '-Wcast-align'?
gcc-8: error: unrecognized command line option '-fcolor-diagnostics'

These seem to be clang option, not gcc's.

Test failure: //backends/gpu/cpp_tests:event_manager_test

The GCC + NVCC build shows a failure under //backends/gpu/...:

bazel test --config=cuda --config=gcc //backends/gpu/...
...
INFO: Elapsed time: 1348.192s, Critical Path: 952.08s
INFO: 4412 processes: 55 internal, 4357 linux-sandbox.
INFO: Build completed, 1 test FAILED, 4412 total actions
//backends/gpu/cpp_tests:memory/block_allocator_test                     PASSED in 0.4s
//backends/gpu/cpp_tests:memory/gpu_buffer_test                          PASSED in 0.2s
//backends/gpu/cpp_tests:memory/sub_allocator_test                       PASSED in 0.1s
//backends/gpu/cpp_tests:module_table_test                               PASSED in 0.9s
//backends/gpu/cpp_tests:stream/wrapper_test                             PASSED in 3.5s
//backends/gpu/mlir_tests/core_runtime:current_context_lifetime.mlir.test PASSED in 6.6s
//backends/gpu/mlir_tests/core_runtime:get_device.mlir.test              PASSED in 1.5s
//backends/gpu/mlir_tests/core_runtime:logging_with_results.mlir.test    PASSED in 1.5s
//backends/gpu/mlir_tests/core_runtime:op_handler.mlir.test              PASSED in 1.5s
//backends/gpu/mlir_tests/core_runtime:tensor_conversion.mlir.test       PASSED in 1.5s
//backends/gpu/mlir_tests/core_runtime:test_ops.mlir.test                PASSED in 6.5s
//backends/gpu/mlir_tests/core_runtime:tf_addv2.mlir.test                PASSED in 6.6s
//backends/gpu/mlir_tests/core_runtime:tf_biasadd.mlir.test              PASSED in 1.5s
//backends/gpu/mlir_tests/core_runtime:tf_cast.mlir.test                 PASSED in 6.5s
//backends/gpu/mlir_tests/core_runtime:tf_const.mlir.test                PASSED in 1.5s
//backends/gpu/mlir_tests/core_runtime:tf_conv2d.mlir.test               PASSED in 7.3s
//backends/gpu/mlir_tests/core_runtime:tf_fusedbatchnorm.mlir.test       PASSED in 6.6s
//backends/gpu/mlir_tests/core_runtime:tf_matmul.mlir.test               PASSED in 6.5s
//backends/gpu/mlir_tests/core_runtime:tf_maxpool.mlir.test              PASSED in 1.5s
//backends/gpu/mlir_tests/core_runtime:tf_mean.mlir.test                 PASSED in 0.5s
//backends/gpu/mlir_tests/core_runtime:tf_pad.mlir.test                  PASSED in 6.5s
//backends/gpu/mlir_tests/core_runtime:tf_reduction_ops.mlir.test        PASSED in 6.6s
//backends/gpu/mlir_tests/core_runtime:tf_relu.mlir.test                 PASSED in 6.5s
//backends/gpu/mlir_tests/core_runtime:tf_softmax.mlir.test              PASSED in 1.5s
//backends/gpu/mlir_tests/core_runtime:tf_tanh.mlir.test                 PASSED in 6.7s
//backends/gpu/mlir_tests/core_runtime:tf_transpose.mlir.test            PASSED in 6.6s
//backends/gpu/mlir_tests/cuda:cublas.mlir.test                          PASSED in 1.0s
//backends/gpu/mlir_tests/cuda:dnn.mlir.test                             PASSED in 1.6s
//backends/gpu/mlir_tests/cuda:event.mlir.test                           PASSED in 0.4s
//backends/gpu/mlir_tests/cuda:launch.mlir.test                          PASSED in 0.5s
//backends/gpu/mlir_tests/cuda:memcpy.mlir.test                          PASSED in 0.4s
//backends/gpu/mlir_tests/cuda:module.mlir.test                          PASSED in 0.5s
//backends/gpu/mlir_tests/cuda:stream.mlir.test                          PASSED in 0.5s
//backends/gpu/cpp_tests:event_manager_test                              FAILED in 227.8s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/cpp_tests/event_manager_test/test.log
Executed 34 out of 34 tests: 33 tests pass and 1 fails locally.

Configuration details: GCC 8.4, CUDA 11.1, Ubuntu 18.04 (x64). The GPU is a Titan RTX.

Is there a C API?

How does TFRT envision usage from other languages? E.g. C#, Java, or similar? A C API would be useful for interop.

BTFWriter source code

In tools/btf_info_tool/btf_info_test.py, we see that there is a BTFWriter. I think it will be helpful to expose the source code for this so users and contributors can test/experiment with it.

Support registering new Kernels without re-compilation of bef_executor

Currently adding a new kernel requires to rebuild the bef_executor. It slows down the development for new kernels, also makes it cumbersome to structure a separate code repository to depend on TFRT repository.

It would be much nicer if new kernels could be compiled into share objects (.so) files, and dynamically loaded into bef_executor

Build fails for //cpp_tests:support/thread_local_test

This is with git HEAD at c4262eb as Apr 23. The ThreadLocal ctor is doing a resize on a vector of Entry which will have WorkerId as a field in this case and the latter doesn't have a copy ctor.

bazel test --sandbox_writable_path=$HOME/.ccache -- //cpp_tests:support/thread_local_test
DEBUG: /home/uday/tensorflow-runtime/third_party/cuda/dependencies.bzl:51:10: The following command will download NVIDIA proprietary software. By using the software you agree to comply with the terms of the license agreement that accompanies the software. If you do not agree to the terms of the license agreement, do not use the software.
INFO: Analyzed target //cpp_tests:support/thread_local_test (0 packages loaded, 0 targets configured).
INFO: Found 1 test target...
ERROR: /home/uday/tensorflow-runtime/cpp_tests/BUILD:324:13: Compiling cpp_tests/support/thread_local_test.cc failed: (Exit 1): clang failed: error executing command /usr/lib64/ccache/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 69 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox clang failed: error executing command /usr/lib64/ccache/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 69 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
In file included from cpp_tests/support/thread_local_test.cc:19:
In file included from include/tfrt/support/thread_local.h:63:
In file included from external/llvm-project/llvm/include/llvm/ADT/STLExtras.h:19:
external/llvm-project/llvm/include/llvm/ADT/Optional.h:113:43: error: call to implicitly-deleted copy constructor of 'tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry'
    ::new ((void *)std::addressof(value)) T(std::forward<Args>(args)...);
                                          ^ ~~~~~~~~~~~~~~~~~~~~~~~~
external/llvm-project/llvm/include/llvm/ADT/Optional.h:74:7: note: in instantiation of function template specialization 'llvm::optional_detail::OptionalStorage<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry, false>::emplace<const tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry &>' requested here
      emplace(other.value);
      ^
/usr/bin/../lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/bits/stl_uninitialized.h:83:8: note: in instantiation of function template specialization 'std::_Construct<llvm::Optional<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry>, const llvm::Optional<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry> &>' requested here
                std::_Construct(std::__addressof(*__cur), *__first);
                     ^
/usr/bin/../lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/bits/stl_uninitialized.h:134:2: note: in instantiation of function template specialization 'std::__uninitialized_copy<false>::__uninit_copy<const llvm::Optional<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry> *, llvm::Optional<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry> *>' requested here
        __uninit_copy(__first, __last, __result);
        ^
/usr/bin/../lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/bits/stl_uninitialized.h:289:19: note: in instantiation of function template specialization 'std::uninitialized_copy<const llvm::Optional<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry> *, llvm::Optional<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry> *>' requested here
    { return std::uninitialized_copy(__first, __last, __result); }
                  ^
/usr/bin/../lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/bits/stl_uninitialized.h:310:19: note: in instantiation of function template specialization 'std::__uninitialized_copy_a<const llvm::Optional<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry> *, llvm::Optional<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry> *, llvm::Optional<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry> >' requested here
      return std::__uninitialized_copy_a
                  ^
/usr/bin/../lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/bits/vector.tcc:611:10: note: in instantiation of function template specialization 'std::__uninitialized_move_if_noexcept_a<llvm::Optional<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry> *, llvm::Optional<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry> *, std::allocator<llvm::Optional<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry> > >' requested here
                  std::__uninitialized_move_if_noexcept_a(
                       ^
/usr/bin/../lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/bits/stl_vector.h:827:4: note: in instantiation of member function 'std::vector<llvm::Optional<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry>, std::allocator<llvm::Optional<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry> > >::_M_default_append' requested here
          _M_default_append(__new_size - size());
          ^
include/tfrt/support/thread_local.h:94:11: note: in instantiation of member function 'std::vector<llvm::Optional<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry>, std::allocator<llvm::Optional<tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::Entry> > >::resize' requested here
    data_.resize(capacity);
          ^
cpp_tests/support/thread_local_test.cc:52:21: note: in instantiation of function template specialization 'tfrt::ThreadLocal<tfrt::(anonymous namespace)::WorkerId, tfrt::(anonymous namespace)::WorkerIdGenerator>::ThreadLocal<int>' requested here
    CurrentWorkerId worker_id(capacity, kInitWorkerId);
                    ^
include/tfrt/support/thread_local.h:199:7: note: copy constructor of 'Entry' is implicitly deleted because field 'value' has a deleted copy constructor
    T value;
      ^
cpp_tests/support/thread_local_test.cc:33:3: note: 'WorkerId' has been explicitly marked deleted here
  WorkerId(const WorkerId&) = delete;
  ^
1 error generated.
Target //cpp_tests:support/thread_local_test failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.281s, Critical Path: 1.15s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully
//cpp_tests:support/thread_local_test                           FAILED TO BUILD

FAILED: Build did NOT complete successfully
clang --version
clang version 10.0.1 (Red Hat 10.0.1-1.module_el8.3.0+467+cb298d5b)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Mobile PoC level support ETA

When is the ETA for supporting mobile devices ?

I wonder the expected performance and memory footprint on android devices.

Thank you.

End to end example

The mnist and resnet examples were very useful. But I was wondering if there are any end to end example where we can go from .py file all the way into BEF executions. Also if we can have the code for tf_runtime/utils/resnet/resnet50_graph_inference_main.py. That'll be super useful.

GPU tests failing with Clang 10 + CUDA 10.2

I noticed 23 failures when running the GPU backend tests using a Clang 10 build (Clang 10.0, CUDA 10.2, Ubuntu 18.04, Titan RTX GPU)

bazel test --config=cuda --repo_env=CUDA_PATH=/usr/local/cuda-10.2 //backends/gpu/...
...
INFO: Build completed, 23 tests FAILED, 1299 total actions
//backends/gpu/cpp_tests:memory/block_allocator_test                     PASSED in 0.3s
//backends/gpu/cpp_tests:memory/gpu_buffer_test                          PASSED in 0.2s
//backends/gpu/cpp_tests:memory/sub_allocator_test                       PASSED in 0.1s
//backends/gpu/cpp_tests:module_table_test                               PASSED in 0.9s
//backends/gpu/mlir_tests/core_runtime:tf_mean.mlir.test                 PASSED in 0.3s
//backends/gpu/mlir_tests/cuda:dnn.mlir.test                             PASSED in 4.8s
//backends/gpu/mlir_tests/cuda:event.mlir.test                           PASSED in 0.4s
//backends/gpu/mlir_tests/cuda:launch.mlir.test                          PASSED in 0.7s
//backends/gpu/mlir_tests/cuda:memcpy.mlir.test                          PASSED in 0.5s
//backends/gpu/mlir_tests/cuda:module.mlir.test                          PASSED in 0.6s
//backends/gpu/mlir_tests/cuda:stream.mlir.test                          PASSED in 0.4s
//backends/gpu/cpp_tests:event_manager_test                              FAILED in 237.8s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/cpp_tests/event_manager_test/test.log
//backends/gpu/cpp_tests:stream/wrapper_test                             FAILED in 0.4s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/cpp_tests/stream/wrapper_test/test.log
//backends/gpu/mlir_tests/core_runtime:current_context_lifetime.mlir.test FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/current_context_lifetime.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:get_device.mlir.test              FAILED in 0.7s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/get_device.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:logging_with_results.mlir.test    FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/logging_with_results.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:op_handler.mlir.test              FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/op_handler.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:tensor_conversion.mlir.test       FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/tensor_conversion.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:test_ops.mlir.test                FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/test_ops.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:tf_addv2.mlir.test                FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/tf_addv2.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:tf_biasadd.mlir.test              FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/tf_biasadd.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:tf_cast.mlir.test                 FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/tf_cast.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:tf_const.mlir.test                FAILED in 0.6s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/tf_const.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:tf_conv2d.mlir.test               FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/tf_conv2d.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:tf_fusedbatchnorm.mlir.test       FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/tf_fusedbatchnorm.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:tf_matmul.mlir.test               FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/tf_matmul.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:tf_maxpool.mlir.test              FAILED in 0.7s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/tf_maxpool.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:tf_pad.mlir.test                  FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/tf_pad.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:tf_reduction_ops.mlir.test        FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/tf_reduction_ops.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:tf_relu.mlir.test                 FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/tf_relu.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:tf_softmax.mlir.test              FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/tf_softmax.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:tf_tanh.mlir.test                 FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/tf_tanh.mlir.test/test.log
//backends/gpu/mlir_tests/core_runtime:tf_transpose.mlir.test            FAILED in 0.5s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/core_runtime/tf_transpose.mlir.test/test.log
//backends/gpu/mlir_tests/cuda:cublas.mlir.test                          FAILED in 1.1s
  /home/lemo/.cache/bazel/_bazel_lemo/b9a83ea24871c2ac3b49c420e1a458ae/execroot/tf_runtime/bazel-out/k8-opt/testlogs/backends/gpu/mlir_tests/cuda/cublas.mlir.test/test.log

Executed 34 out of 34 tests: 11 tests pass and 23 fail locally.
INFO: Build completed, 23 tests FAILED, 1299 total actions

how to integrate fallback kernels with TFRT

Hi @mhong
I found out that recently a "runtime fallback" dialect is added to tensorflow https://github.com/tensorflow/tensorflow/blob/410c66fa83537ea07e5158df915744931f461bfa/tensorflow/compiler/mlir/tfrt/runtime_fallback/runtime_fallback_ops.td (but seems removed in tensorflow/tensorflow@902ffed)

It seems that every op in tf dialect will be converted to a tfd.delegated_kernel

I wonder how to run this tfd.delegated_kernel in tfrt aka. translated into bef and how to register into tfrt kernel to make fallback kernel runnable. And why this code removed in tf repo? Any change for the plan of supporting fallback runtime or is there a new roadmap

Thanks!

Uninitialized tensors as buffer handles?

Is it possible to tell TFRT not to allocate memory for uninitialized tensors in MLIR but keep their attributes (dimensions, total size, unique std::hash-able instance, etc.)?

The device I`m writing a backend for does not work off the CPU memory: all constants need to be sent to it through DMA, and in case of uninitialized buffers it`s useless to DMA zeroes back and forth.
Furthermore, some networks the device is intended for can really clog the CPU memory if all unique uninitialized buffers it requires get (needlessly) allocated.

Can this be avoided — and if yes, how exactly?

`bazel clean` seems to be broken

bazel clean
WARNING: Blaze clean does not support starlark options. Ignoring options: [--@rules_cuda//cuda:cuda_targets=sm_60, --@rules_cuda//cuda:compiler=clang]
ERROR: Unrecognized arguments: --@rules_cuda//cuda:cuda_runtime=@tf_runtime//backends/gpu:cuda_stubs

Perhaps related to bazelbuild/bazel#11506 ?

distributed runtime

There were some references to a distributed_runtime but looks like that folder wasn't open-sourced. Are there any plans to open source it ?

Thanks

Upstream MLIR change introduced a Windows build break

An upstream MLIR change introduced a dependency on llvm::ThreadPool. The problem is that this thread pool is currently disabled on Windows to workaround an LLVM bug.

ERROR: external/llvm-project/mlir/BUILD:5066:10: Linking external/llvm-project/mlir/mlir-linalg-ods-yaml-gen.exe [for host] failed: (Exit 1120): link.exe failed: error executing command C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/HostX64/x64/link.exe @bazel-out/host/bin/external/llvm-project/mlir/mlir-linalg-ods-yaml-gen.exe-2.params
IR.lib(Verifier.obj) : error LNK2019: unresolved external symbol "public: bool __cdecl llvm::ThreadPool::isWorkerThread(void)const " (?isWorkerThread@ThreadPool@llvm@@QEBA_NXZ) referenced in function "struct mlir::LogicalResult __cdecl mlir::failableParallelForEach<class mlir::Operation * *,class <lambda_1e2c9a1d5fe91ce52e6f54677d3c54a3> >(class mlir::MLIRContext *,class mlir::Operation * *,class mlir::Operation * *,class <lambda_1e2c9a1d5fe91ce52e6f54677d3c54a3> 
&&)" (??$failableParallelForEach@PEAPEAVOperation@mlir@@V<lambda_1e2c9a1d5fe91ce52e6f54677d3c54a3>@@@mlir@@YA?AULogicalResult@0@PEAVMLIRContext@0@PEAPEAVOperation@0@1$$QEAV<lambda_1e2c9a1d5fe91ce52e6f54677d3c54a3>@@@Z)
bazel-out\host\bin\external\llvm-project\mlir\mlir-linalg-ods-yaml-gen.exe : fatal error LNK1120: 1 unresolved externals
Target //tools:bef_executor failed to build

Fold rules_cuda into bazelbuild/rules_cuda

Ideally rules_cuda should be split away from this project. Even the README of rules_cuda has the repo located at its own repository.

You probably have this tracked internally, but for the rest of us, I thought it would be a good idea to open this ticket as somewhere we can refer. I get that this is probably pretty low priority.

Thanks for your work chsigg and team

tf.Pad always gets the default padding instead of the one from parameter

Hi, I am running tf.Pad and find that the padding value of tf.Pad is pre-defined instead of being retrieved from the 2nd parameter of tf.Pad, as the following code shows. It seems that it is encouraged to use _tf.Pad which puts padding in its attribute. Anway, I am wondering how to fix it elegently. In the ExecuteOnOpHandlerImpl, the meta function can only access the TensorMetadata, while for tf.Pad, the padding should be retrieved from the DenseGpuTensor ignored in the following comment. Is there suggestion on that? thanks in advance.

https://github.com/tensorflow/runtime/blob/master/backends/common/lib/ops/tf/metadata_functions.cc
TfPadOpMd
std::fill_n(default_paddings.begin() + spatial_offset, 4, 3); <<<<-------- predefined [3,3], [3,3]

https://github.com/tensorflow/runtime/blob/master/backends/gpu/lib/ops/tf/pad_op.cc
static llvm::Expected GpuPadOp(
GpuDispatchContext* dctx, const DenseGpuTensor& input,
const DenseGpuTensor& /* paddings input is ignored */,
const TensorMetadata& result_md) {

build fails with clang / GCC-8 on CentOS 8.3 - stddef.h not found

This is with git c4262eb as of Apr 23. The build fails with the error below although the pre-requisites mentioned in the README are met: clang-11 and GCC-8. It looks like using clang-11 with libstdc++-8 isn't sufficient here. More details below.

bazel build //tools:tfrt_translate fails with:

INFO: Analyzed target //tools:tfrt_translate (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/uday/.cache/bazel/_bazel_uday/0a58b4eb202e02a9cdf9e8f6aa753460/external/zlib/BUILD.bazel:5:11: Compiling uncompr.c [for host] failed: (Exit 1): clang failed: error executing command /usr/lib64/ccache/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 23 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox clang failed: error executing command /usr/lib64/ccache/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 23 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
In file included from external/zlib/uncompr.c:9:
In file included from external/zlib/zlib.h:34:
external/zlib/zconf.h:247:14: fatal error: 'stddef.h' file not found
#    include <stddef.h>
             ^~~~~~~~~~
clang++ -v |& grep "Selected GCC"
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/8
gcc --version
gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
rpm -qa | grep libstdc++
libstdc++-devel-8.3.1-5.1.el8.x86_64
libstdc++-8.3.1-5.1.el8.x86_64

CentOS Linux release 8.3.2011

bazel --version
bazel 4.0.0

I can reproduce the same issue after updating clang-11.1.0 (the version mentioned in the tensorflow/runtime README) as well:

clang --version
clang version 11.1.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Output debugging data from within operation kernels

This is not an issue but rather a question.

How do I correctly organize debug output from functions that go under TFRT_KERNEL in registry->AddKernel()?
I`ve tried writing something to stdout, stderr and even to a file, but nothing seems to work.

StringAttribute has to be the first attribute in Kernel signature?

Hi,
I write a kernel that takes a StringAttribute and an Attribute. StringAttribute has to be the first attribute in kernel signature to make it work. Is this behavior expected? You can reproduce this problem by changing MaxPool2D kernel signature order in backends/cpu/lib/ops/test/resnet_tensor_kernels.cc then running tests in backends/cpu/mlir_tests/resnet/max_pool.mlir.

Thanks.

tflite vs. tfrt

Is it TensorFlow RT somehow replacing or overriding TensorFlow-Lite? how do you compare side-by-side TensorFlow-Lite and TensorFlow RT?
Does have the TensorFlow RT for the embedded-class device?
Does it have its own mechanisms to access on-device special neural accelerator (NPU) so e.g. no NNAPI is needed to access it?

Thank you.

Debug build failure with NVCC (device code)

bazel build -c dbg --config=cuda --config=gcc //tools:bef_executor
...
ERROR: /home/lemo/work/tfrt/backends/gpu/BUILD:484:13: Compiling backends/gpu/lib/ops/tf/unary_ops.cu.cc failed: (Exit 2): nvcc failed: error executing command external/local_cuda/cuda/bin/nvcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g -MD -MF ... (remaining 153 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox nvcc failed: error executing command external/local_cuda/cuda/bin/nvcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g -MD -MF ... (remaining 153 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
include/tfrt/host_context/kernel_utils.h(1072): error: type name is not allowed

include/tfrt/host_context/kernel_utils.h(1072): error: expected an expression

2 errors detected in the compilation of "backends/gpu/lib/ops/tf/unary_ops.cu.cc".

ResNet50 test does not verify the result

Seems like the only check the ResNet50 test has is this one:
// CHECK: int1 = 1
How should I amend it so that it could actually verify TFRT for RN50 conformance?
Am I missing something?

bazel clean gives an error: unrecognized arguments --@rules_cuda

After a fresh clone of the current git tip 46ba4b6, I can reproduce:

$ bazel clean
WARNING: Blaze clean does not support starlark options. Ignoring options: [--@rules_cuda//cuda:cuda_targets=sm_60, --@rules_cuda//cuda:compiler=clang, --@rules_cuda//cuda:copts=-Wno-unknown-cuda-version]
ERROR: Unrecognized arguments: --@rules_cuda//cuda:cuda_runtime=@tf_runtime//backends/gpu:cuda_stubs

bazel --version
bazel 4.0.0

I can reproduce this on too very different OSs - Ubuntu 20.04 LTS and CentOS 8.3.2011 with the same bazel version.

Infinite recursion error when building cuda targets

My machine is running Ubuntu 18.04 with an nvidia 2080 gpu.

I run the following command after following the setup instructions and verifying cuda / clang work:

bazel build //tools:bef_executor

I get the following error:

ERROR: infinite symlink expansion detected
[start of symlink chain]
/usr/bin/X11
/usr/bin
[end of symlink chain]
INFO: Repository llvm-project instantiated at:
  /home/kevin/src/tensorflow/runtime/WORKSPACE:22:18: in <toplevel>
  /home/kevin/src/tensorflow/runtime/dependencies.bzl:38:9: in tfrt_dependencies
  /home/kevin/src/tensorflow/runtime/third_party/llvm/workspace.bzl:10:22: in repo
  /home/kevin/src/tensorflow/runtime/third_party/repo.bzl:114:23: in tfrt_http_archive
Repository rule _tfrt_http_archive defined at:
  /home/kevin/src/tensorflow/runtime/third_party/repo.bzl:65:37: in <toplevel>
ERROR: /home/kevin/.cache/bazel/_bazel_kevin/706c0853b511db4c8e87dca8def87940/external/rules_cuda/cuda/BUILD:128:20: every rule of type cuda_toolchain_info implicitly depends upon the target '@local_cuda//:cuda/bin/nvcc', but this target could not be found because of: no such package '@local_cuda//': Symlink issue while evaluating globs: Infinite symlink expansion: /usr/bin/X11- > /usr/bin

Bazel version: 4.0.0

I ran ls -l /usr/bin/X11, and I see that it points to /usr/bin. Hence the recursive symlink.

I also ran dpkg -S /usr/bin/X11 and I see that it is install by the apt package x11-common.

I'm afraid to just remove that symlink on my system because I assume it is there for a reason, and I'm afraid things will break.

It appears that something somewhere is globbing all the files under /usr/bin, but that causes infinite symlink recursion if x11-common is installed.

Output from clang -v:

Ubuntu clang version 11.1.0-++20210428103915+1fdec59bffc1-1~exp1~20210428204556.164
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Candidate multilib: .;@m64
Selected multilib: .;@m64
Found CUDA installation: /usr/local/cuda, version 10.2

I installed clang-11 from the llvm PPA.

Failing to build the debug version with GCC

bazel build --config=cuda --config=gcc -c dbg //tools:bef_executor

...

ERROR: /home/lemo/work/tfrt/backends/gpu/BUILD:96:16: Compiling backends/gpu/lib/stream/dnn_wrapper.cc failed: (Exit 1): gcc-7 failed: error executing command /usr/bin/gcc-7 -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g -MD -MF ... (remaining 70 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox gcc-7 failed: error executing command /usr/bin/gcc-7 -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g -MD -MF ... (remaining 70 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
In file included from external/llvm-project/llvm/include/llvm/ADT/Hashing.h:48:0,
                 from external/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:12,
                 from external/llvm-project/llvm/include/llvm/ADT/DenseMapInfo.h:18,
                 from external/llvm-project/llvm/include/llvm/ADT/PointerUnion.h:17,
                 from backends/gpu/include/tfrt/gpu/stream/stream_wrapper.h:98,
                 from backends/gpu/include/tfrt/gpu/stream/dnn_wrapper.h:29,
                 from backends/gpu/lib/stream/dnn_wrapper.cc:20:
backends/gpu/lib/stream/dnn_wrapper.cc: In function 'constexpr auto tfrt::gpu::stream::ToCuda(tfrt::gpu::stream::DnnDataType)':
backends/gpu/lib/stream/dnn_wrapper.cc:57:3: error: call to non-constexpr function 'void llvm::llvm_unreachable_internal(const char*, const char*, unsigned int)'
   llvm_unreachable(StrCat("Unrecognized DnnDataType: ", data_type).c_str());
   ^
backends/gpu/lib/stream/dnn_wrapper.cc: In function 'constexpr cudnnPoolingMode_t tfrt::gpu::stream::ToCuda(tfrt::gpu::stream::DnnPoolingMode)':
backends/gpu/lib/stream/dnn_wrapper.cc:71:3: error: call to non-constexpr function 'void llvm::llvm_unreachable_internal(const char*, const char*, unsigned int)'
   llvm_unreachable(StrCat("Unrecognized DnnPoolingMode mode: ", mode).c_str());
   ^
backends/gpu/lib/stream/dnn_wrapper.cc: In function 'constexpr auto tfrt::gpu::stream::ToCuda(tfrt::gpu::stream::DnnNanPropagation)':
backends/gpu/lib/stream/dnn_wrapper.cc:81:3: error: call to non-constexpr function 'void llvm::llvm_unreachable_internal(const char*, const char*, unsigned int)'
   llvm_unreachable(StrCat("Unrecognized DnnNanPropagation nan: ", nan).c_str());
   ^
At global scope:
cc1plus: warning: unrecognized command line option '-Wno-unused-local-typedef'
Target //tools:bef_executor failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 59.200s, Critical Path: 57.34s
INFO: 277 processes: 32 internal, 245 linux-sandbox.
FAILED: Build did NOT complete successfully

TFRT/MLIR as stand-alone executable

Since MLIR is a flexible infrastructure doing transformations, is it possible to generate an executable model for the mobile device (target) after the model were prepared/trained - so no runtime such as TensorFlow-lite is needed, and the app can directly use this artifact (executable model)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.