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

Validate user-supplied outputSizes of MLConvTranspose2dOptions and MLPool2dOptions #818

Closed
huningxin opened this issue Feb 18, 2025 · 1 comment · Fixed by #820
Closed
Assignees
Labels

Comments

@huningxin
Copy link
Contributor

huningxin commented Feb 18, 2025

This issue is tracking discussion in PR review #814 (comment) and #814 (comment).

The current algorithm steps of convTranspose2d and create pooling operation don't validate outputSizes attribute when it exists in MLConvTranspose2dOptions and MLPool2dOptions.

As a reference, Chromium prototype validates MLConvTranspose2dOptions.outputSizes and MLPool2dOptions.outputSizes.

/cc @inexorabletash

@inexorabletash
Copy link
Member

I have a local change for this and other missing edge cases. I'll put it up once #819 lands

inexorabletash added a commit to inexorabletash/webnn that referenced this issue Feb 19, 2025
A follow-on to webmachinelearning#706 and the
[audit](https://docs.google.com/spreadsheets/d/1S5-bMWN1hDrkPGiHFCyX-OjcbEBj1a-aWNdtTQ2dcGg)
by @huningxin that adds validation steps to several ops identified for
edge cases in the Chromium prototype implementation.

This touches the following ops:

- convTranspose2d - outputSizes items must be valid dimensions
- lstm - steps must be greater than 0
- pool2d - windowDimensions must be greater than 0
- pool2d - outputSizes items must be valid dimensions
- pool2d - specified output sizes must be floor() or ceil() of calculated output sizes
- split - splits (if a number) must be greater than 0

Fixes webmachinelearning#818 as well.
@fdwr fdwr closed this as completed in #820 Feb 22, 2025
fdwr pushed a commit that referenced this issue Feb 22, 2025
* Add missing validation steps for several ops

A follow-on to #706 and the
[audit](https://docs.google.com/spreadsheets/d/1S5-bMWN1hDrkPGiHFCyX-OjcbEBj1a-aWNdtTQ2dcGg)
by @huningxin that adds validation steps to several ops identified for
edge cases in the Chromium prototype implementation.

This touches the following ops:

- convTranspose2d - outputSizes items must be valid dimensions
- lstm - steps must be greater than 0
- pool2d - windowDimensions must be greater than 0
- pool2d - outputSizes items must be valid dimensions
- pool2d - specified output sizes must be floor() or ceil() of calculated output sizes
- split - splits (if a number) must be greater than 0

Fixes #818 as well.

* Review feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants