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

Allow using extended minimal build for multiple EPs #23834

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fs-eire
Copy link
Contributor

@fs-eire fs-eire commented Feb 27, 2025

Description

Background

From code search, the following EPs use onnxruntime::GetCpuPreferredNodes() in their GetCapabilities() methods:

  • CANN
  • CUDA
  • DML
  • JS
  • ROCM
  • WebGPU

However, the source file that implements onnxruntime::GetCpuPreferredNodes() is excluded when minimal build is ON:

if (onnxruntime_MINIMAL_BUILD)
set(onnxruntime_framework_src_exclude
"${ONNXRUNTIME_ROOT}/core/framework/fallback_cpu_capability.h"
"${ONNXRUNTIME_ROOT}/core/framework/fallback_cpu_capability.cc"
)

This means that all EPs mentioned above is not able to compile with minimal build.

Solution

The excluded file core/framework/fallback_cpu_capability.cc cannot build in minimal build because some of its dependencies are not included in the minimal build. However, in extended minimal build mode, all dependencies are available.

This PR looses the restrict and allows to compile this file when it is extended minimal build. After this change, those EPs are able to compile in extended minimal build.

@FricoRico
Copy link

Confirmed this fixes building on for Android using --minimal_build

@grazder
Copy link

grazder commented Feb 28, 2025

I tried too with --use_jsep, everything works

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.

3 participants