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

[WebNN] Improve data type check of slice op #22988

Merged
merged 3 commits into from
Dec 10, 2024
Merged

Conversation

shiyi9801
Copy link
Contributor

A follow-up of [WebNN] Support negative steps for slice. Slice op is emulated by reverse+slice when steps < 0 so SliceOpBuilder::HasSupportedInputsImpl() should also check the supported data types of reverse.

@shiyi9801
Copy link
Contributor Author

@Honry PTAL, thanks!

Copy link
Contributor

@Honry Honry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @shiyi9801, data type check is not rigorous in WebNN EP, especially for those ONNX ops that need to be supported by decomposed WebNN ops. This is a good starting.👍

Co-authored-by: Wanming Lin <[email protected]>
Copy link
Contributor

@Honry Honry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@shiyi9801
Copy link
Contributor Author

Hi @fdwr PTAL, thanks!

fdwr
fdwr previously approved these changes Dec 6, 2024
Copy link
Contributor

@fdwr fdwr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@fdwr
Copy link
Contributor

fdwr commented Dec 6, 2024

/azp run ONNX Runtime Web CI Pipeline,Windows GPU CI Pipeline,Linux Android Emulator QNN CI Pipeline

@fdwr
Copy link
Contributor

fdwr commented Dec 6, 2024

/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,Linux QNN CI Pipeline,MacOS CI Pipeline,Windows ARM64 QNN CI Pipeline,Windows CPU CI Pipeline

@fdwr
Copy link
Contributor

fdwr commented Dec 6, 2024

/azp run Windows GPU CUDA CI Pipeline,Windows GPU DML CI Pipeline,Windows GPU Doc Gen CI Pipeline

@fdwr
Copy link
Contributor

fdwr commented Dec 6, 2024

/azp run Windows GPU TensorRT CI Pipeline,onnxruntime-binary-size-checks-ci-pipeline,orttraining-linux-ci-pipeline,orttraining-linux-gpu-ci-pipeline,orttraining-ortmodule-distributed,Windows x64 QNN CI Pipeline,Big Models

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link

Azure Pipelines successfully started running 4 pipeline(s).

Copy link

Azure Pipelines successfully started running 9 pipeline(s).

@fdwr
Copy link
Contributor

fdwr commented Dec 6, 2024

/azp run Python format, orttraining-linux-ci-pipeline

Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@fdwr
Copy link
Contributor

fdwr commented Dec 7, 2024

The bothersome linter appears to complain about this line...

    LOGS(logger, VERBOSE) << "[" << onnx_op_type << "] " << onnx_input_output_name
                          << "'s data type: [" << onnx_data_type <------------------------
                          << "] is not supported by WebNN op ["
                          << webnn_op_type << "] for now";

...but I can't tell what's wrong o_o. https://github.com/microsoft/onnxruntime/actions/runs/12151097208/job/34052156380?pr=22988

All other tests passed.

@shiyi9801
Copy link
Contributor Author

The bothersome linter appears to complain about this line...

    LOGS(logger, VERBOSE) << "[" << onnx_op_type << "] " << onnx_input_output_name
                          << "'s data type: [" << onnx_data_type <------------------------
                          << "] is not supported by WebNN op ["
                          << webnn_op_type << "] for now";

...but I can't tell what's wrong o_o. https://github.com/microsoft/onnxruntime/actions/runs/12151097208/job/34052156380?pr=22988

All other tests passed.

There is a trailing whitespace

<< "'s data type: [" << onnx_data_type <------------------------

so the linter clang-format complained🥲 Fixed it, please help approve again, thanks! @fdwr

Copy link
Contributor

@fdwr fdwr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@fdwr
Copy link
Contributor

fdwr commented Dec 10, 2024

/azp run ONNX Runtime Web CI Pipeline,Windows GPU CI Pipeline,Linux Android Emulator QNN CI Pipeline

@fdwr
Copy link
Contributor

fdwr commented Dec 10, 2024

/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,Linux QNN CI Pipeline,MacOS CI Pipeline,Windows ARM64 QNN CI Pipeline,Windows CPU CI Pipeline

@fdwr
Copy link
Contributor

fdwr commented Dec 10, 2024

/azp run Windows GPU CUDA CI Pipeline,Windows GPU DML CI Pipeline,Windows GPU Doc Gen CI Pipeline

@fdwr
Copy link
Contributor

fdwr commented Dec 10, 2024

/azp run Windows GPU TensorRT CI Pipeline,onnxruntime-binary-size-checks-ci-pipeline,orttraining-linux-ci-pipeline,orttraining-linux-gpu-ci-pipeline,orttraining-ortmodule-distributed,Windows x64 QNN CI Pipeline,Big Models

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link

Azure Pipelines successfully started running 4 pipeline(s).

Copy link

Azure Pipelines successfully started running 9 pipeline(s).

@fdwr fdwr merged commit 02f0af0 into microsoft:main Dec 10, 2024
77 checks passed
ankitm3k pushed a commit to intel/onnxruntime that referenced this pull request Dec 11, 2024
A follow-up of [[WebNN] Support negative steps for
slice](microsoft#22871 (comment)).
Slice op is emulated by reverse+slice when steps < 0 so
`SliceOpBuilder::HasSupportedInputsImpl()` should also check the
supported data types of reverse.

---------

Co-authored-by: Wanming Lin <[email protected]>
ankitm3k pushed a commit to intel/onnxruntime that referenced this pull request Dec 11, 2024
A follow-up of [[WebNN] Support negative steps for
slice](microsoft#22871 (comment)).
Slice op is emulated by reverse+slice when steps < 0 so
`SliceOpBuilder::HasSupportedInputsImpl()` should also check the
supported data types of reverse.

---------

Co-authored-by: Wanming Lin <[email protected]>
ankitm3k pushed a commit to intel/onnxruntime that referenced this pull request Dec 11, 2024
A follow-up of [[WebNN] Support negative steps for
slice](microsoft#22871 (comment)).
Slice op is emulated by reverse+slice when steps < 0 so
`SliceOpBuilder::HasSupportedInputsImpl()` should also check the
supported data types of reverse.

---------

Co-authored-by: Wanming Lin <[email protected]>
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