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

DynamicToFixedShape: use ort shape infer tool, accept 0 as dim_value #1600

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

Conversation

jambayk
Copy link
Contributor

@jambayk jambayk commented Feb 6, 2025

Describe your changes

  • onnxruntime.tools.onnx_model_utils.fix_output_shapes cannot handle large models (Unable to export model by using --device npu --provider QNNExecutionProvider #1595), so we use the ort shape infer helper and handle the logic ourselves. This also means it can now handle models with contrib operators too.
  • allow passing 0 as dim_value. this case is possible when creating a prompt processing model from a dynamic shaped llm where we want to make the past kv cache empty.

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.
  • Is this PR including examples changes? If yes, please remember to update example documentation in a follow-up PR.

(Optional) Issue link

update test

input shape must be > 0
@jambayk jambayk force-pushed the jambayk/shape-infer branch from 6f393de to 1a61af3 Compare February 7, 2025 20:05
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.

1 participant