Skip to content
Snippets Groups Projects
Select Git revision
  • 7bea56c640ca372a4dda892e1228c0eed9c1dbbd
  • master default protected
  • cvh
  • main
4 results

cpu.bazelrc

Blame
  • cpu.bazelrc 1.62 KiB
    # This bazelrc can build a CPU-supporting TF package.
    # Hopefully it's compatible with manylinux2010.
    
    # Convenient cache configurations
    # Use a cache directory mounted to /tf/cache. Very useful!
    build:sigbuild_local_cache --disk_cache=/tf/cache
    # Use the public-access TF DevInfra cache (read only)
    build:sigbuild_remote_cache --remote_cache="https://storage.googleapis.com/tensorflow-devinfra-bazel-cache" --remote_upload_local_results=false
    # Write to the TF DevInfra cache (only works for internal TF CI)
    build:sigbuild_remote_cache_push --remote_cache="https://storage.googleapis.com/tensorflow-devinfra-bazel-cache" --google_default_credentials
    
    # Use Python 3.X as installed in container image
    build --action_env PYTHON_BIN_PATH="/usr/bin/python3"
    build --action_env PYTHON_LIB_PATH="/usr/lib/tf_python"
    build --python_path="/usr/bin/python3"
    
    # Build TensorFlow v2
    build --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
    
    # Prevent double-compilation of some TF code, ref. b/183279666 (internal)
    # > TF's gen_api_init_files has a genrule to run the core TensorFlow code
    # > on the host machine. If we don't have --distinct_host_configuration=false,
    # > the core TensorFlow code will be built once for the host and once for the
    # > target platform.
    # See also https://docs.bazel.build/versions/master/guide.html#build-configurations-and-cross-compilation
    build --distinct_host_configuration=false
    
    # Target the AVX instruction set
    build --copt=-mavx --host_copt=-mavx
    
    # Use the NVCC toolchain to compile for manylinux2010
    build --crosstool_top=@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda11.2:toolchain