Skip to content

Commit

Permalink
Update tensorflow to 2.11 (continuation of #8258)
Browse files Browse the repository at this point in the history
  • Loading branch information
iarspider committed May 22, 2023
1 parent 2095db0 commit cc6b98a
Show file tree
Hide file tree
Showing 19 changed files with 51 additions and 28 deletions.
2 changes: 1 addition & 1 deletion abseil-cpp.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### RPM external abseil-cpp 20210324.2
### RPM external abseil-cpp 20220623.1
Source: https://github.com/abseil/abseil-cpp/archive/%{realversion}.tar.gz

BuildRequires: cmake gmake
Expand Down
12 changes: 6 additions & 6 deletions bazel-3.7.0-patches.patch
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
diff --git a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkActionFactoryApi.java b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkActionFactoryApi.java
index 0ea30a9..8df189f 100755
index 9f7fe1f..e584fb9 100755
--- a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkActionFactoryApi.java
+++ b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkActionFactoryApi.java
@@ -359,7 +359,7 @@ public interface StarlarkActionFactoryApi extends StarlarkValue {
@@ -377,7 +377,7 @@ public interface StarlarkActionFactoryApi extends StarlarkValue {
+ " the former are more efficient."),
@Param(
name = "use_default_shell_env",
type = Boolean.class,
- defaultValue = "False",
+ defaultValue = "True",
named = true,
positional = false,
doc = "Whether the action should use the built in shell environment or not."),
diff --git a/tools/cpp/unix_cc_configure.bzl b/tools/cpp/unix_cc_configure.bzl
index d48485b..40ca051 100755
index bfb37bd..45e311c 100755
--- a/tools/cpp/unix_cc_configure.bzl
+++ b/tools/cpp/unix_cc_configure.bzl
@@ -193,6 +193,7 @@ def _find_gold_linker_path(repository_ctx, cc):
@@ -184,6 +184,7 @@ def _find_linker_path(repository_ctx, cc, linker, is_clang):
Returns:
String to put as value to -fuse-ld= flag, or None if gold couldn't be found.
String to put as value to -fuse-ld= flag, or None if linker couldn't be found.
"""
+ return None
result = repository_ctx.execute([
Expand Down
4 changes: 1 addition & 3 deletions bazel.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### RPM external bazel 3.7.2
### RPM external bazel 6.0.0

Source: https://github.com/bazelbuild/bazel/releases/download/%{realversion}/bazel-%{realversion}-dist.zip

Expand All @@ -17,7 +17,6 @@ BuildRequires: java-env python3 python-python3
# configuration issue
# https://github.com/bazelbuild/bazel/issues/9392
Patch0: bazel-3.7.0-patches
Patch1: bazel-3.7.2-gcc11

%prep

Expand All @@ -26,7 +25,6 @@ Patch1: bazel-3.7.2-gcc11
%setup -q -n bazel-%{realversion}

%patch0 -p1
%patch1 -p1

%build

Expand Down
4 changes: 2 additions & 2 deletions eigen.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### RPM external eigen 82dd3710dac619448f50331c1d6a35da673f764a
### RPM external eigen 3bb6a48d8c171cf20b5f8e48bfb4e424fbd4f79e
## INITENV +PATH PKG_CONFIG_PATH %{i}/share/pkgconfig
## NOCOMPILER
%define tag 43d8892d117e4e76b6c472b942ebefee00bfc172
%define tag fe7e6a8ef4921dd6c7b5b893a9972948f1b451d3
%define branch cms/master/%{realversion}
%define github_user cms-externals
Source: git+https://github.com/%{github_user}/eigen-git-mirror.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}-%{tag}.tgz
Expand Down
5 changes: 4 additions & 1 deletion flatbuffers.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### RPM external flatbuffers 1.12.0
### RPM external flatbuffers 2.0.8
## INITENV +PATH LD_LIBRARY_PATH %{i}/lib64

%define tag v%{realversion}
Expand Down Expand Up @@ -29,3 +29,6 @@ make -v %{makeprocesses}
cd ../build

make %{makeprocesses} install

%post
%{relocateConfig}lib64/pkgconfig/flatbuffers.pc
3 changes: 2 additions & 1 deletion gbl.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### RPM external gbl V02-04-01
### RPM external gbl V03-00-00

%define tag 31e726d777fe93cdbed0c363dc15f803f7767f40
Source: git+https://gitlab.desy.de/claus.kleinwort/general-broken-lines.git?obj=main/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz
Expand All @@ -18,6 +18,7 @@ cd build
cmake ../cpp \
-DCMAKE_INSTALL_PREFIX=%{i} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DEIGEN3_INCLUDE_DIR=${EIGEN_ROOT}/include/eigen3 \
-DSUPPORT_ROOT=False

Expand Down
2 changes: 1 addition & 1 deletion giflib.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### RPM external giflib 5.2.0
### RPM external giflib 5.2.1

Source: https://sourceforge.net/projects/giflib/files/giflib-%{realversion}.tar.gz
BuildRequires: autotools
Expand Down
4 changes: 2 additions & 2 deletions java-env.spec
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
### RPM external java-env 1.1
### RPM external java-env 11.0
## INITENV SET JAVA_HOME %{java_home}
## INITENV +PATH PATH %{java_home}/bin
## INITENV +PATH LD_LIBRARY_PATH %{java_home}/lib
## NOCOMPILER

%define java_home /usr/lib/jvm/java
%define java_home /etc/alternatives/jre_11
Source: none

%prep
Expand Down
1 change: 1 addition & 0 deletions lwtnn.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ cmake ../%{n}-%{realversion} \
-G Ninja \
-DCMAKE_CXX_COMPILER="g++" \
-DCMAKE_CXX_FLAGS="-fPIC" \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_INSTALL_PREFIX:PATH="%{i}" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILTIN_BOOST=OFF \
Expand Down
3 changes: 2 additions & 1 deletion opencv.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### RPM external opencv 4.5.5
### RPM external opencv 4.7.0
## INITENV +PATH PYTHON3PATH %{i}/${PYTHON3_LIB_SITE_PACKAGES}
%define tag %{realversion}
%define branch master
Expand All @@ -19,6 +19,7 @@ cd ../build
cmake ../%{n}-%{realversion} \
-GNinja \
-DCMAKE_INSTALL_PREFIX="%{i}" \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_INSTALL_LIBDIR=lib \
-DWITH_EIGEN=ON \
-DBUILD_EXAMPLES=OFF \
Expand Down
1 change: 1 addition & 0 deletions pip/cython.file
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
%define source0 https://github.com/cython/cython/archive/%{realversion}.tar.gz
%define pip_name Cython
7 changes: 4 additions & 3 deletions pip/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ cryptography==40.0.2
cryptography==3.2.1 ; cmsos_name=='slc7'
cx-Oracle==8.3.0
cycler==0.11.0
cython==0.29.34
cython==3.0.0a11
dask==2023.4.0
dask-awkward==2023.4.1
decorator==5.1.1
Expand Down Expand Up @@ -165,7 +165,7 @@ jupyter-server-mathjax==0.2.6
jupyter-server-terminals==0.4.4
jupyterlab-widgets==3.0.7
#NO_AUTO_UPDATE: needs newer TF
keras==2.6.0
keras==2.11.0
keras-applications==1.0.8
keras-preprocessing==1.1.2
keras2onnx==1.7.0
Expand Down Expand Up @@ -340,8 +340,9 @@ sympy==1.11.1
tables==3.8.0
tenacity==8.2.2
#NO_AUTO_UPDATE:1: Force to use tensorflow 2.6.4; this should match the version in tensorflow-sources.spec
tensorflow==2.6.4
tensorflow==2.11.0
tensorboard==2.12.1
tensorflow-io-gcs-filesystem==0.30.0
tensorflow-estimator==2.12.0
tensorboard-data-server==0.7.0
tensorboard-plugin-wit==1.8.1
Expand Down
2 changes: 2 additions & 0 deletions pip/tensorflow-io-gcs-filesystem.file
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
%define source0 https://github.com/tensorflow/io/archive/refs/tags/v0.30.0.tar.gz
%define PipPreBuild export PIP_GLOBAL_OPTION="--project tensorflow-io-gcs-filesystem"
2 changes: 2 additions & 0 deletions pip/tensorflow.file
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ Requires: py3-tensorboard py3-opt-einsum py3-tensorflow-estimator py3-wrapt py3-
Requires: tensorflow-sources
%define PipPreBuildPy PIPFILE=${TENSORFLOW_SOURCES_ROOT}/tensorflow-%{realversion}-cp%{cms_python3_major_minor}-cp%{cms_python3_major_minor}-linux_%{_arch}.whl
%define PipPostBuild rm -f %{i}/bin/tensorboard* ; ls %{i}/bin/* | xargs -i mv '{}' '{}3'
%define PipDepsPost | grep -v libclang
## INCLUDE tensorflow-requires
Requires: py3-funcsigs py3-pbr py3-packaging py3-appdirs py3-pyparsing py3-mock py3-Werkzeug
Requires: py3-grpcio py3-astunparse py3-keras
Requires: py3-tensorflow-io-gcs-filesystem
Requires: llvm
%define source0 none
%define source_file none
Expand Down
5 changes: 4 additions & 1 deletion professor2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ Patch0: professor2-ppc64-flag-change
%ifarch ppc64le
%patch0 -p1
%endif
sed -i -e 's|^ *CXXSTD *:=.*|CXXSTD:=c++17|' Makefile
sed -i -e 's|std=c++11|std=c++17|' pyext/setup.py

%define build_flags CPPFLAGS=-I${EIGEN_ROOT}/include/eigen3 PYTHON=$(which python3) PROF_VERSION=%{realversion} PYTHONPATH=./${PYTHON3_LIB_SITE_PACKAGES}

%define build_flags CPPFLAGS=-I${EIGEN_ROOT}/include/eigen3 PYTHON=$(which python3) PROF_VERSION=%{realversion} PYTHONPATH=./${PYTHON3_LIB_SITE_PACKAGES}:./pyext/professor2

%build
make %{build_flags}
Expand Down
2 changes: 0 additions & 2 deletions scram-tools.file/tools/abseil-cpp/abseil-cpp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<lib name="absl_hash"/>
<lib name="absl_hashtablez_sampler"/>
<lib name="absl_int128"/>
<lib name="absl_leak_check_disable"/>
<lib name="absl_leak_check"/>
<lib name="absl_log_severity"/>
<lib name="absl_malloc_internal"/>
Expand Down Expand Up @@ -60,7 +59,6 @@
<lib name="absl_throw_delegate"/>
<lib name="absl_time"/>
<lib name="absl_time_zone"/>
<lib name="absl_wyhash"/>
<client>
<environment name="ABSEIL_CPP_BASE" default="@TOOL_ROOT@"/>
<environment name="LIBDIR" default="$ABSEIL_CPP_BASE/lib"/>
Expand Down
14 changes: 13 additions & 1 deletion tensorflow-sources.file
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ BAZEL_OPTS="$BAZEL_OPTS --copt=-mcpu=native --copt=-mtune=native"
%endif
BAZEL_OPTS="$BAZEL_OPTS --config=%{build_type} --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 %{makeprocesses}"
BAZEL_OPTS="$BAZEL_OPTS --config=noaws --config=nogcp --config=nohdfs --config=nonccl"
%ifarch ppc64le
BAZEL_OPTS="$BAZEL_OPTS --define=tflite_with_xnnpack=false"
%endif

%if %{enable_gpu}
BAZEL_OPTS="$BAZEL_OPTS --config=cuda"
Expand Down Expand Up @@ -85,7 +88,6 @@ echo "cython:" >> ${TF_CMS_EXTERNALS}
echo "flatbuffers:${FLATBUFFERS_ROOT}" >> ${TF_CMS_EXTERNALS}
echo "pybind11:${PY3_PYBIND11_ROOT}" >> ${TF_CMS_EXTERNALS}
echo "functools32_archive:" >> ${TF_CMS_EXTERNALS}
echo "enum34_archive:" >> ${TF_CMS_EXTERNALS}
echo "astor_archive:" >> ${TF_CMS_EXTERNALS}
echo "six_archive:" >> ${TF_CMS_EXTERNALS}
echo "absl_py:" >> ${TF_CMS_EXTERNALS}
Expand Down Expand Up @@ -187,6 +189,7 @@ copy_headers() {
copy_headers "$PWD" tensorflow/compiler
copy_headers "$PWD" tensorflow/core/profiler/internal
copy_headers "$PWD" tensorflow/core/profiler/lib
copy_headers "$PWD" tensorflow/core/util/tensor_bundle

# do not copy the protobuf headers as we use the version in cmsdist
# copy_headers "$PWD/tensorflow/contrib/makefile/downloads/protobuf/src" google
Expand All @@ -197,5 +200,14 @@ popd

%endif

#FIXME: for some reason farmhash_gpu.h is a broken symlink
optdir=$(ls -d $PWD/bazel-out/*-%{build_type})
if [ -L ${optdir}/bin/external/farmhash_gpu_archive/_virtual_includes/farmhash_gpu/third_party/farmhash_gpu/src/farmhash_gpu.h ] ; then
if [ ! -e ${optdir}/bin/external/farmhash_gpu_archive/_virtual_includes/farmhash_gpu/third_party/farmhash_gpu/src/farmhash_gpu.h ] ; then
ln -sf ${optdir}/bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external/farmhash_gpu_archive/src/farmhash_gpu.h \
${optdir}/bin/external/farmhash_gpu_archive/_virtual_includes/farmhash_gpu/third_party/farmhash_gpu/src/farmhash_gpu.h
fi
fi

# create the wheel file that is installed in py2-tensorflow
bazel-bin/tensorflow/tools/pip_package/build_pip_package %{i}
4 changes: 2 additions & 2 deletions tensorflow-sources.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### RPM external tensorflow-sources 2.6.4
%define tag 0b5069862cb4347fcb482f285a323b26d6453a98
### RPM external tensorflow-sources 2.11.0
%define tag 0b4e6b59fbec01a74aa7bfee560f6bb23b35a610
%define branch cms/v%{realversion}
%define github_user cms-externals
%define python_cmd python3
Expand Down
2 changes: 1 addition & 1 deletion tensorflow.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### RPM external tensorflow 2.6.4
### RPM external tensorflow 2.11.0
%if "%{?vectorized_package:set}" != "set"
%define source_package tensorflow-sources
%else
Expand Down

0 comments on commit cc6b98a

Please sign in to comment.