You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reduce toolchain size by preserving TensorFlow library symlinks.
Bazel produces multiple TensorFlow library artifacts:
```
$ ls -alh tensorflow/bazel-bin/tensorflow
18B libtensorflow.so -> libtensorflow.so.1
23B libtensorflow.so.1 -> libtensorflow.so.1.14.0
277M libtensorflow.so.1.14.0
```
Previously, TensorFlow libraries were copied via `cp -p`.
This did not preserve symlinks, leading to library duplication:
```
$ ls -alh <TOOLCHAIN_BEFORE>.xctoolchain/usr/lib/swift/macosx
18B libtensorflow.so -> libtensorflow.so.1
277M libtensorflow.so.1
277M libtensorflow.so.1.14.0 # duplicate library
```
Now, `cp -a` is used, which preserves symlinks:
```
$ ls -alh <TOOLCHAIN_AFTER>.xctoolchain/usr/lib/swift/macosx
18B libtensorflow.so -> libtensorflow.so.1
277M libtensorflow.so.1
```
This combined with removing libtensorflow_framework.so dependency
(swiftlang#27029) led to a macOS toolchain
size reduction from 3.99 GB to 3.62 GB on the tensorflow-0.5 branch.
0 commit comments