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

Two fixes involving minimal builds #17000

Merged
merged 6 commits into from
Aug 23, 2023
Merged

Conversation

skottmckay
Copy link
Contributor

@skottmckay skottmckay commented Aug 4, 2023

Description

  • allocation planner was breaking if graph had no nodes

    • in this particular model a branch of an If node returned an outer scope value directly.
  • if model used non-tensor types and sparse tensors are disabled the call to IsSpareTensor causes an exception when prematurely terminates the code.

    • it's perfectly fine to check if a value is a sparse tensor when support for them is disabled. we just can't do anything with that OrtValue which is what the current ifdef's after the call to IsSparseTensor handle.

Motivation and Context

Fix model execution failure for partner with model that uses sequences in a minimal build with sparse tensors disabled.

- allocation planner was breaking if graph had no nodes
  - in this particular model a branch of an If node returned an outer scope value directly.

- if model used non-tensor types and sparse tensors are disabled the call to IsSpareTensor causes an exception when prematurely terminates the code.
  - it's perfectly fine to check if a value is a sparse tensor when support for them is disabled. we just can't do anything with that OrtValue which is what the current ifdef's after the call to IsSparseTensor handle.
@skottmckay skottmckay requested a review from souptc August 4, 2023 06:46
- Update required ops for tests.
  - Manually updated required_ops.config
    - diffs with current version are massive and the config generation doesn't handle invalid model (we have one to test invalid external data).
  - updated required_ops_and_types.config as per readme
  - Not sure why there's a big gap in the configs. Unit tests for minimal build must not be using all the ORT format models which is understandable as testing a minimal build vs minimal build with operator reduction are two separate types of usage.
edgchen1
edgchen1 previously approved these changes Aug 22, 2023
onnxruntime/test/framework/ort_model_only_test.cc Outdated Show resolved Hide resolved
onnxruntime/test/framework/ort_model_only_test.cc Outdated Show resolved Hide resolved
@skottmckay skottmckay merged commit b3cb775 into main Aug 23, 2023
95 checks passed
@skottmckay skottmckay deleted the skottmckay/FixMinimalBuildIssues branch August 23, 2023 06:01
@faxu faxu added the triage:approved Approved for cherrypicks for release label Aug 24, 2023
er3x3 pushed a commit that referenced this pull request Aug 28, 2023
### Description
<!-- Describe your changes. -->
- allocation planner was breaking if graph had no nodes
- in this particular model a branch of an If node returned an outer
scope value directly.

- if model used non-tensor types and sparse tensors are disabled the
call to IsSpareTensor causes an exception when prematurely terminates
the code.
- it's perfectly fine to check if a value is a sparse tensor when
support for them is disabled. we just can't do anything with that
OrtValue which is what the current ifdef's after the call to
IsSparseTensor handle.




### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Fix model execution failure for partner with model that uses sequences
in a minimal build with sparse tensors disabled.
snnn pushed a commit that referenced this pull request Aug 28, 2023
kleiti pushed a commit to kleiti/onnxruntime that referenced this pull request Mar 22, 2024
### Description
<!-- Describe your changes. -->
- allocation planner was breaking if graph had no nodes
- in this particular model a branch of an If node returned an outer
scope value directly.

- if model used non-tensor types and sparse tensors are disabled the
call to IsSpareTensor causes an exception when prematurely terminates
the code.
- it's perfectly fine to check if a value is a sparse tensor when
support for them is disabled. we just can't do anything with that
OrtValue which is what the current ifdef's after the call to
IsSparseTensor handle.




### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Fix model execution failure for partner with model that uses sequences
in a minimal build with sparse tensors disabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage:approved Approved for cherrypicks for release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants