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

Enable LTO for Android build #21243

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Enable LTO for Android build #21243

wants to merge 2 commits into from

Conversation

snnn
Copy link
Member

@snnn snnn commented Jul 3, 2024

Description

Enable LTO for Android build, which can reduce binary size by 6%.

Motivation and Context

@snnn snnn requested review from edgchen1 and skottmckay July 3, 2024 19:19
@edgchen1
Copy link
Contributor

edgchen1 commented Jul 3, 2024

should we also enable this in a build that gets tested more? e.g., the actual package builds that will be published and CI builds.

@snnn
Copy link
Member Author

snnn commented Jul 3, 2024

should we also enable this in a build that gets tested more? e.g., the actual package builds that will be published and CI builds.

Where should I modify?

@edgchen1
Copy link
Contributor

edgchen1 commented Jul 4, 2024

should we also enable this in a build that gets tested more? e.g., the actual package builds that will be published and CI builds.

Where should I modify?

package build settings are here:

"build_params": [
"--android",
"--parallel",
"--cmake_generator=Ninja",
"--build_java",
"--build_shared_lib",
"--use_nnapi",
"--use_xnnpack",
"--skip_tests"
]

"build_params": [
"--android",
"--parallel",
"--cmake_generator=Ninja",
"--build_java",
"--build_shared_lib",
"--use_nnapi",
"--use_xnnpack",
"--skip_tests",
"--enable_training_apis"
]

CI build is here:
https://github.com/microsoft/onnxruntime/blob/main/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml

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

Successfully merging this pull request may close these issues.

None yet

2 participants