Skip to content
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

[Build] libonnxruntime.so file is occupying 751 MB out of the entire Jar (788.4 MB) #18859

Open
heflinstephenraj-sa-14411 opened this issue Dec 18, 2023 · 3 comments
Labels
api:Java issues related to the Java API build build issues; typically submitted using template stale issues that have not been addressed in a while; categorized by a bot

Comments

@heflinstephenraj-sa-14411

Describe the issue

Hi,
I have created a custom java build with training enabled with the below command.

.\build.bat --config RelWithDebInfo --build_shared_lib --parallel --enable_training --skip_tests  --build_java

The JAR size is 260 MB. When I extracted the JAR and tried to understand why it is heavier compared to the one available for inference on the internet (45 MB), I noticed that the file onnxruntime-1.17.0/ai/onnxruntime/native/linux-x64/libonnxruntime.so is occupying 751 MB out of the entire JAR (788.4 MB).

Are there any ways to reduce the size of the JAR?

Urgency

No response

Target platform

Ubuntu 22.04.1

Build script

.\build.bat --config RelWithDebInfo --build_shared_lib --parallel --enable_training --skip_tests --build_java

Error / output

I did not encounter any errors while using the generated JAR for training on the Linux platform.

Visual Studio Version

No response

GCC / Compiler Version

gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

@heflinstephenraj-sa-14411 heflinstephenraj-sa-14411 added the build build issues; typically submitted using template label Dec 18, 2023
@github-actions github-actions bot added the api:Java issues related to the Java API label Dec 18, 2023
@skottmckay
Copy link
Contributor

Use Release as the config so the debug info is not included in the .so.

@heflinstephenraj-sa-14411
Copy link
Author

Thanks @skottmckay
Now the training jar size is around 10 MB.

Copy link
Contributor

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@github-actions github-actions bot added the stale issues that have not been addressed in a while; categorized by a bot label Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api:Java issues related to the Java API build build issues; typically submitted using template stale issues that have not been addressed in a while; categorized by a bot
Projects
None yet
Development

No branches or pull requests

2 participants