Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Why library size so large #7871

Closed
feiyuvl opened this issue Sep 13, 2017 · 10 comments
Closed

Why library size so large #7871

feiyuvl opened this issue Sep 13, 2017 · 10 comments

Comments

@feiyuvl
Copy link

feiyuvl commented Sep 13, 2017

I found the libmxnet.so is still very large (about 80MB) after I modified the Makefile options. Then I checked the object files in build dir and got this.
default

The operator dir occupies the most part of the total build size. And some *_gpu.o generated by nvcc is much larger
Uploading gpu.JPG…

@chinakook
Copy link
Contributor

Because you build all nvidia sm types such as sm_52

@feiyuvl
Copy link
Author

feiyuvl commented Sep 14, 2017

@chinakook No, I modify the make.config, only keep sm_61. Original libmxnet.so is about 500M. What's your library size?

@chinakook
Copy link
Contributor

151MB

@feiyuvl
Copy link
Author

feiyuvl commented Sep 14, 2017

@piiswrong Any advices on reducing the gpu obj size?

@szha
Copy link
Member

szha commented Sep 14, 2017

Dynamic links for dependencies such as cudnn tend to reduce the size. What's the problem with the library size? Is there a specific use case that requires small library size for you?

@feiyuvl
Copy link
Author

feiyuvl commented Sep 15, 2017

We are deploying mxnet for inference, and need library size as small as possible.

@szha
Copy link
Member

szha commented Sep 17, 2017

Is it on special hardware where disk is very limited?

@feiyuvl
Copy link
Author

feiyuvl commented Sep 18, 2017

No, just feel it is too large. A single obj file generated by some op is about 10M which is unreasonable. Maybe the using of template in mshadow causes this.
default

@szha
Copy link
Member

szha commented Sep 27, 2017

Unrolled loops with instantiation of many types tend to do that... Closing for now since there doesn't seem to be actionable item here. Feel free to reopen if this causes issue.

@szha szha closed this as completed Sep 27, 2017
@tada123
Copy link

tada123 commented Sep 16, 2023

I get 240MiB libmxnet.so size (built with CUDA disabled), which is really big. Is there any CMake definition/option to reduce it at least under 100MiB (got 217MiB after stripping debugging symbols, which is still very large)?

Could you please reopen the issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants