-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable TF XLA, add tensorflow-xla-runtime. #9005
Changes from 5 commits
0f8b473
cf12ea3
e40b72c
cc33bb3
f77258c
12f9496
a1019af
c2096d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
%define vectorized_packages zlib fastjet tensorflow-sources tensorflow OpenBLAS rivet gbl | ||
%define vectorized_packages zlib fastjet tensorflow-sources tensorflow tensorflow-xla-runtime OpenBLAS rivet gbl | ||
%{expand:%(for t in %{vectorized_packages} ; do echo Requires: $t; for v in %{package_vectorization}; do echo Requires: ${t}_${v}; done; done)} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Requires: py3-six | ||
Requires: py3-six py3-tabulate py3-pytest py3-pytest-xdist |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
BuildRequires: py3-hatchling py3-hatch-vcs |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Requires: py3-pytest py3-execnet |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
BuildRequires: py3-hatchling py3-hatch-vcs |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<tool name="py3-tensorflow" version="@TOOL_VERSION@"> | ||
<client> | ||
<environment name="PY3_TENSORFLOW_BASE" default="@TOOL_ROOT@"/> | ||
</client> | ||
<runtime name="PATH" value="$PY3_TENSORFLOW_BASE/bin" type="path"/> | ||
</tool> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<tool name="tensorflow-includes" version="@TOOL_VERSION@"> | ||
<client> | ||
<environment name="TENSORFLOW_INCLUDES_BASE" default="@TOOL_ROOT@"/> | ||
<environment name="INCLUDE" default="$TENSORFLOW_INCLUDES_BASE/@PYTHON3_LIB_SITE_PACKAGES@/tensorflow/include"/> | ||
</client> | ||
</tool> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<tool name="tensorflow-xla-runtime" version="@TOOL_VERSION@"> | ||
<client> | ||
<environment name="TENSORFLOW_XLA_RUNTIME_BASE" default="@TOOL_ROOT@"/> | ||
<environment name="LIBDIR" default="$TENSORFLOW_XLA_RUNTIME_BASE/lib/archive"/> | ||
<environment name="INCLUDE" default="$TENSORFLOW_XLA_RUNTIME_BASE/include"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @riga, I guess this is not needed any more ... right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. It's removed now. |
||
</client> | ||
<lib name="tf_xla_runtime-static"/> | ||
<use name="eigen"/> | ||
<use name="tensorflow-includes"/> | ||
</tool> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<tool name="tensorflow-xla-runtime_@TOOL_VECTORIZATION@" version="@TOOL_VERSION@"> | ||
<client> | ||
<environment name="@TOOL_VECTORIZATION_KEY@_LIBDIR" default="@TOOL_ROOT@/lib"/> | ||
</client> | ||
</tool> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
### RPM external tensorflow-xla-runtime 2.12.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @riga, we need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added 👍 |
||
## INCLUDE cpp-standard | ||
|
||
Requires: eigen py3-tensorflow | ||
BuildRequires: cmake | ||
|
||
%prep | ||
|
||
cp -r ${PY3_TENSORFLOW_ROOT}/lib/python%{cms_python3_major_minor_version}/site-packages/tensorflow . | ||
|
||
%build | ||
|
||
export CPATH="${CPATH}:${EIGEN_ROOT}/include/eigen3" | ||
|
||
pushd tensorflow/xla_aot_runtime_src | ||
cmake . -DCMAKE_CXX_FLAGS="-fPIC -msse3" -DCMAKE_CXX_STANDARD=%{cms_cxx_standard} -DBUILD_SHARED_LIBS=OFF | ||
make %{makeprocesses} | ||
popd | ||
|
||
%install | ||
|
||
mkdir -p %{i}/lib/archive | ||
mv tensorflow/xla_aot_runtime_src/libtf_xla_runtime.a %{i}/lib/archive/libtf_xla_runtime-static.a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@riga, please also update https://github.com/cms-sw/cmsdist/blob/IB/CMSSW_14_1_X/master/vectorization/cmsdist_packages.py#L14-L22 and include
tensorflow-xla-runtime
in the listThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah sorry, I forgot to mention, please also add
scram-tools.file/tools/tensorflow-xla-runtime/vectorized.tmpl
file same as https://github.com/cms-sw/cmsdist/blob/IB/CMSSW_14_1_X/master/scram-tools.file/tools/tensorflow/vectorized.tmpl except that the toolname
should betensorflow-xla-runtime_@TOOL_VECTORIZATION@