-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[VitisAI] Fix OrtShapeInferContext for optional inputs #26199
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
[VitisAI] Fix OrtShapeInferContext for optional inputs #26199
Conversation
### Description When there is an optional input (empty input type) in the OrtShapeInferContext construction, use undefined data type and empty shape as a placeholder. ### Motivation and Context VitisAI EP may add nodes with optional inputs during graph optimization to meet the requirements of AMD AI compilers. This fix may help other execution providers to improve the graph optimization process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the OrtShapeInferContext constructor to properly handle optional inputs by adding a null check for input types. When an input type is null (indicating an optional input), it now creates a placeholder with undefined data type and empty shape instead of attempting to process a null pointer.
- Added null check for input_type before processing tensor type information
- Added fallback logic to create placeholder type and shape info for optional inputs
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@microsoft-github-policy-service agree company="AMD" |
/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline |
Azure Pipelines successfully started running 4 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
When there is an optional input (empty input type) in the OrtShapeInferContext construction, use undefined data type and empty shape as a placeholder.
Motivation and Context
VitisAI EP may add nodes with optional inputs during graph optimization to meet the requirements of AMD AI compilers.
This fix may help other execution providers to improve the graph optimization process.