Skip to content

Add length checks to fusion_transpose.py#17608

Merged
tianleiwu merged 5 commits intomicrosoft:mainfrom
kazssym:transformers-fusion-transpose
Oct 6, 2023
Merged

Add length checks to fusion_transpose.py#17608
tianleiwu merged 5 commits intomicrosoft:mainfrom
kazssym:transformers-fusion-transpose

Conversation

@kazssym
Copy link
Copy Markdown
Contributor

@kazssym kazssym commented Sep 19, 2023

Description

This change adds list length checks to node's inputs in fusion_transpose.py. It bypasses the optimization if not applicable.

Motivation and Context

Those nodes have fewer inputs in an older opset and cause runtime exceptions.

@kazssym kazssym marked this pull request as ready for review September 19, 2023 11:41
@tianleiwu
Copy link
Copy Markdown
Contributor

/azp run Linux CPU CI Pipeline, Linux CPU Minimal Build E2E CI Pipeline, Linux GPU CI Pipeline, Linux GPU TensorRT CI Pipeline, Linux OpenVINO CI Pipeline, MacOS CI Pipeline, ONNX Runtime Web CI Pipeline, onnxruntime-binary-size-checks-ci-pipeline, Linux QNN CI Pipeline

@tianleiwu
Copy link
Copy Markdown
Contributor

/azp run Windows CPU CI Pipeline, Windows GPU CI Pipeline, Windows GPU TensorRT CI Pipeline, Windows ARM64 QNN CI Pipeline, orttraining-linux-ci-pipeline, orttraining-linux-gpu-ci-pipeline, orttraining-ortmodule-distributed, ONNX Runtime React Native CI Pipeline

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 9 pipeline(s).

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 8 pipeline(s).

@tianleiwu
Copy link
Copy Markdown
Contributor

@kazssym, one required pipeline of python format failed. Please run lintrunner -a according to https://github.com/microsoft/onnxruntime/blob/main/docs/Coding_Conventions_and_Standards.md#linting

@kazssym
Copy link
Copy Markdown
Contributor Author

kazssym commented Oct 1, 2023

I just have synced to main.

@tianleiwu
Copy link
Copy Markdown
Contributor

/azp run Linux CPU CI Pipeline, Linux CPU Minimal Build E2E CI Pipeline, Linux GPU CI Pipeline, Linux GPU TensorRT CI Pipeline, Linux OpenVINO CI Pipeline, MacOS CI Pipeline, ONNX Runtime Web CI Pipeline, onnxruntime-binary-size-checks-ci-pipeline, Linux QNN CI Pipeline

@tianleiwu
Copy link
Copy Markdown
Contributor

/azp run Windows CPU CI Pipeline, Windows GPU CI Pipeline, Windows GPU TensorRT CI Pipeline, Windows ARM64 QNN CI Pipeline, orttraining-linux-ci-pipeline, orttraining-linux-gpu-ci-pipeline, orttraining-ortmodule-distributed, ONNX Runtime React Native CI Pipeline, Windows x64 QNN CI Pipeline

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 9 pipeline(s).

1 similar comment
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 9 pipeline(s).

@tianleiwu
Copy link
Copy Markdown
Contributor

Looks good to me. Unsqueeze-13 has two inputs, older opset (<13) has only one input.

@tianleiwu tianleiwu merged commit be1e51a into microsoft:main Oct 6, 2023
kleiti pushed a commit to kleiti/onnxruntime that referenced this pull request Mar 22, 2024
This change adds list length checks to node's inputs in fusion_transpose.py. It bypasses the optimization if not applicable.

### Motivation and Context
Unsqueeze in opset (<13) has only one input and cause runtime exceptions.
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.

2 participants