Skip to content

TF package size fix #3983

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

Merged
merged 9 commits into from
Jul 10, 2019
Merged

TF package size fix #3983

merged 9 commits into from
Jul 10, 2019

Conversation

harishsk
Copy link
Contributor

The Tensorflow tar files contain libtensorflow.so, libtensorflow.so.$(MajorVersion) and libtensorflow.so.$(Version). Of these, the first two are symlinked to the third. When these files get copied over to the nuget package, they are copied as files and not as symlinks which causes the package size to almost triple.
This fix reduces the copied files to only libtensorflow.so and libtensorflow_framework.so.$(MajorVersion).

@@ -9,20 +9,12 @@
<TensorFlowConfig Include="windows" FileExtension=".zip" FilesFromArchive="lib\tensorflow.dll;include\tensorflow\c\LICENSE" Runtime="win-x64"/>
<TensorFlowConfig Include="linux" FileExtension=".tar.gz"
FilesFromArchive="lib\libtensorflow.so;
lib\libtensorflow.so.$(TensorFlowMajorVersion);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all these dynamic libraries not necessary then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The binaries deleted are identical to the ones remaining. They are symlinked in the tar file. But when they get to the nuget package, they become copies.
This change keeps only the ones that are used.

@@ -9,20 +9,12 @@
<TensorFlowConfig Include="windows" FileExtension=".zip" FilesFromArchive="lib\tensorflow.dll;include\tensorflow\c\LICENSE" Runtime="win-x64"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could you format the windows config the same way you did below for linux and mac?
Not important if you are not doing another iteration.

@harishsk harishsk merged commit c3bdaaa into dotnet:master Jul 10, 2019
@harishsk harishsk deleted the TFPackageSizeFix branch July 10, 2019 23:48
Dmitry-A pushed a commit to Dmitry-A/machinelearning that referenced this pull request Jul 24, 2019
* Reduced list of TF binaries to only the essential ones

* Fixed formatting
@ghost ghost locked as resolved and limited conversation to collaborators Mar 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants