-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address review comments by @smuzaffar.
- Loading branch information
Showing
6 changed files
with
26 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
6 changes: 6 additions & 0 deletions
6
scram-tools.file/tools/py3-tensorflow/tensorflow-includes.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ | |
</client> | ||
<lib name="tf_xla_runtime-static"/> | ||
<use name="eigen"/> | ||
<use name="tensorflow-includes"/> | ||
</tool> |
5 changes: 5 additions & 0 deletions
5
scram-tools.file/tools/tensorflow-xla-runtime/vectorized.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,23 @@ | ||
### RPM external tensorflow-xla-runtime 2.12.0 | ||
## INCLUDE cpp-standard | ||
|
||
Requires: eigen tensorflow-sources | ||
Requires: eigen py3-tensorflow | ||
BuildRequires: cmake | ||
|
||
%prep | ||
unzip -q -o ${TENSORFLOW_SOURCES_ROOT}/tensorflow-%{realversion}-cp%{cms_python3_major_minor}-cp%{cms_python3_major_minor}-linux_%{_arch}.whl | ||
|
||
%build | ||
cp -r ${PY3_TENSORFLOW_ROOT}/lib/python%{cms_python3_major_minor_version}/site-packages/tensorflow . | ||
|
||
# fix a single comparison between size_t and int | ||
sed -i -r 's/assert\(\(arg_size\(index\)/assert\(\(\(size_t\)arg_size\(index\)/' tensorflow/include/tensorflow/compiler/tf2xla/xla_compiled_cpu_function.h | ||
%build | ||
|
||
export CPATH="${CPATH}:${EIGEN_ROOT}/include/eigen3" | ||
export CPATH="${CPATH}:%{i}/tensorflow/include" | ||
export CPATH="${CPATH}:%{i}/tensorflow/include/third_party/eigen3" | ||
|
||
pushd tensorflow/xla_aot_runtime_src | ||
cmake . -DCMAKE_CXX_FLAGS="-fPIC -msse3" | ||
cmake . -DCMAKE_CXX_FLAGS="-fPIC -msse3" -DCMAKE_CXX_STANDARD=%{cms_cxx_standard} -DBUILD_SHARED_LIBS=OFF | ||
make %{makeprocesses} | ||
# this builds a shared library, but when used some symbols are missig (e.g `tsl::mutex::unlock()') | ||
# so it does not seem intended to be used as a shared lib | ||
gcc -shared -o libtf_xla_runtime.so -Wl,--whole-archive libtf_xla_runtime.a -Wl,--no-whole-archive | ||
popd | ||
|
||
%install | ||
|
||
mv tensorflow/include %{i} | ||
|
||
mkdir -p %{i}/lib/archive | ||
mv tensorflow/xla_aot_runtime_src/libtf_xla_runtime.a %{i}/lib/archive/libtf_xla_runtime-static.a | ||
mv tensorflow/xla_aot_runtime_src/libtf_xla_runtime.so %{i}/lib/libtf_xla_runtime.so |