Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ONNX Export for Max and Average Pooling in CEIL_MODE#16769

Closed
lara-hdr wants to merge 12 commits into
pytorch:masterfrom
lara-hdr:lahaidar/onnx_ceil_pooling
Closed

ONNX Export for Max and Average Pooling in CEIL_MODE#16769
lara-hdr wants to merge 12 commits into
pytorch:masterfrom
lara-hdr:lahaidar/onnx_ceil_pooling

Conversation

@lara-hdr
Copy link
Copy Markdown
Contributor

@lara-hdr lara-hdr commented Feb 5, 2019

No description provided.

Copy link
Copy Markdown
Contributor

@apaszke apaszke left a comment

Choose a reason for hiding this comment

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

Now that we're moving away from expect files for the JIT I would love to see the same happen for ONNX tests 😕 To be honest 1k added of expect files is quite a lot.

Copy link
Copy Markdown
Member

@houseroad houseroad left a comment

Choose a reason for hiding this comment

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

We don't want to introduce too many expect files, since it has obvious drawbacks. So one expect test for one op sounds reasonable. MaxPool should be already covered. AveragePool we can add a simple one which should be around 20 lines. To test the operators thoroughly, usually we do end to end test to make sure that the exported models are interpreted correctly in Caffe2. So in this case, I would suggest you to add tests in https://github.com/pytorch/pytorch/blob/master/test/onnx/test_pytorch_onnx_caffe2.py to cover different conditions.

@lara-hdr
Copy link
Copy Markdown
Contributor Author

@houseroad, does this PR look better now that the tests are changed for tests in test_pytorch_onnx_caffe2.py ?

@houseroad
Copy link
Copy Markdown
Member

No, the CI still fail, especially, the onnx one. I will take a look when I get time. Also feel free to check what cause the problem in the CI as well.

@dashesy
Copy link
Copy Markdown
Contributor

dashesy commented Mar 4, 2019

Some related issues: (onnx/onnx#549) and (onnx/tutorials#39) and (#2898) and (#16336)

Comment thread torch/onnx/symbolic.py
Comment thread torch/onnx/symbolic.py Outdated
Copy link
Copy Markdown
Member

@houseroad houseroad left a comment

Choose a reason for hiding this comment

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

The problem is caused by the division on the integer type.

Please explicitly set the type, otherwise, we will have such problems.
If you use the python 2 environment, you should be able to reproduce it.

@lara-hdr
Copy link
Copy Markdown
Contributor Author

lara-hdr commented Mar 5, 2019

Thank you @houseroad for your help debugging the issue :)

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Comment thread torch/onnx/symbolic.py
return g.op('Softplus', self)


def get_pool_ceil_padding(input, kernel_size, stride, padding):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: add some comments about the purpose of this function.

Copy link
Copy Markdown
Member

@houseroad houseroad left a comment

Choose a reason for hiding this comment

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

Looks good to me.

laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary: Pull Request resolved: pytorch#16769

Differential Revision: D14362175

Pulled By: houseroad

fbshipit-source-id: 65cfb1dfba6a43d39cc85374add368fe8e4e5645
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants