Tensorflow benchmark build

I attempted to build the TensorFlow benchmark using Bazel, but the build failed. I would like to know if I should use the Clang compiler because I used TensorFlow version 2.14.0. Does anyone know the procedure for building the TensorFlow benchmark?

Hi @rita19991020

Yes, you should use the Clang compiler to build the TensorFlow benchmark with TensorFlow version 2.14.0. The Clang compiler is the recommended compiler for TensorFlow.

Please refer to this Tensorflow build from source doc which might be helpful to you.

thanks for apply !!
but I still have problem…
do you have any idea?

yerin@DESKTOP-UI4C2BO:~/bazel/tensorflow$ bazel build -c opt --config=android_arm64 tensorflow/lite/tools/benchmark:benchmark_model
INFO: Reading ‘startup’ options from /home/yerin/bazel/tensorflow/.bazelrc: --windows_enable_symlinks
INFO: Options provided by the client:
Inherited ‘common’ options: --isatty=1 --terminal_columns=280
INFO: Reading rc options for ‘build’ from /home/yerin/bazel/tensorflow/.bazelrc:
Inherited ‘common’ options: --experimental_repo_remote_exec
INFO: Reading rc options for ‘build’ from /home/yerin/bazel/tensorflow/.bazelrc:
‘build’ options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --features=-force_no_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility
INFO: Reading rc options for ‘build’ from /home/yerin/bazel/tensorflow/.tf_configure.bazelrc:
‘build’ options: --action_env PYTHON_BIN_PATH=/home/yerin/anaconda3/envs/rec/bin/python3 --action_env PYTHON_LIB_PATH=/home/yerin/anaconda3/envs/rec/lib/python3.11/site-packages --python_path=/home/yerin/anaconda3/envs/rec/bin/python3 --action_env CLANG_COMPILER_PATH=/home/yerin/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16 --repo_env=CC=/home/yerin/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16 --repo_env=BAZEL_COMPILER=/home/yerin/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16 --copt=-Wno-gnu-offsetof-extensions
INFO: Found applicable config definition build:short_logs in file /home/yerin/bazel/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /home/yerin/bazel/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:android_arm64 in file /home/yerin/bazel/tensorflow/.bazelrc: --config=android --cpu=arm64-v8a --fat_apk_cpu=arm64-v8a
INFO: Found applicable config definition build:android in file /home/yerin/bazel/tensorflow/.bazelrc: --crosstool_top=//external:android/crosstool --host_crosstool_top=@bazel_tools//tools/cpp:toolchain --dynamic_mode=off --noenable_platform_specific_config --copt=-w --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --define=with_xla_support=false --config=no_tfrt
INFO: Found applicable config definition build:no_tfrt in file /home/yerin/bazel/tensorflow/.bazelrc: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/ir,tensorflow/compiler/mlir/tfrt/ir/mlrt,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ifrt,tensorflow/compiler/mlir/tfrt/tests/mlrt,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/compiler/mlir/tfrt/transforms/mlrt,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/runtime_fallback/test,tensorflow/core/runtime_fallback/test/gpu,tensorflow/core/runtime_fallback/test/saved_model,tensorflow/core/runtime_fallback/test/testdata,tensorflow/core/tfrt/stubs,tensorflow/core/tfrt/tfrt_session,tensorflow/core/tfrt/mlrt,tensorflow/core/tfrt/mlrt/attribute,tensorflow/core/tfrt/mlrt/kernel,tensorflow/core/tfrt/mlrt/bytecode,tensorflow/core/tfrt/mlrt/interpreter,tensorflow/compiler/mlir/tfrt/translate/mlrt,tensorflow/compiler/mlir/tfrt/translate/mlrt/testdata,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils,tensorflow/core/tfrt/utils/debug,tensorflow/core/tfrt/saved_model/python,tensorflow/core/tfrt/graph_executor/python,tensorflow/core/tfrt/saved_model/utils
ERROR: /home/yerin/.cache/bazel/_bazel_yerin/e83aa6472320bb4da5fea35b05bfb229/external/local_config_cc/BUILD:47:19: in cc_toolchain_suite rule @local_config_cc//:toolchain: cc_toolchain_suite ‘@local_config_cc//:toolchain’ does not contain a toolchain for cpu ‘arm64-v8a’
ERROR: /home/yerin/.cache/bazel/_bazel_yerin/e83aa6472320bb4da5fea35b05bfb229/external/local_config_cc/BUILD:47:19: Analysis of target ‘@local_config_cc//:toolchain’ failed
ERROR: Analysis of target ‘//tensorflow/lite/tools/benchmark:benchmark_model’ failed; build aborted:
INFO: Elapsed time: 0.064s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)

Please check the Note for Linux CPU-builds for Aarch64/ARM64

Starting with TensorFlow 2.10 , Linux CPU-builds for Aarch64/ARM64 processors are built, maintained, tested and released by a third party: AWS. Installing the tensorflow package on an ARM machine installs AWS’s tensorflow-cpu-aws package. They are provided as-is. Tensorflow will use reasonable efforts to maintain the availability and integrity of this pip package. There may be delays if the third party fails to release the pip package. See this blog post for more information about this collaboration.