Skip to content

[ONNX] Enable _jit_pass_onnx_fold_if only when dynamic_axes is None#50582

Merged
BowenBao merged 19 commits intopytorch:onnx_ms_1from
jiafatom:test_faster_rcnn
Jan 20, 2021
Merged

[ONNX] Enable _jit_pass_onnx_fold_if only when dynamic_axes is None#50582
BowenBao merged 19 commits intopytorch:onnx_ms_1from
jiafatom:test_faster_rcnn

Conversation

@jiafatom
Copy link
Copy Markdown
Contributor

@jiafatom jiafatom commented Jan 15, 2021

Fixing pytorch/vision#3251 (PR #49410 triggers the torch vision test build failure, on three tests test_faster_rcnn, test_mask_rcnn, test_keypoint_rcnn. )

The offending PR is fine on pytorch UT, because the torchvision and pytorch test has a gap when we merge them - we are using different test API on two sides, therefore causing some discrepancy.

This PR bridge the gap for the above three tests, and disable _jit_pass_onnx_fold_if pass until it gets fixed.
Allow _jit_pass_onnx_fold_if only when dynamic_axes is None.

@jiafatom jiafatom changed the title [ONNX] Modify test_faster_rcnn to adapt torch vision test [WIP][ONNX] Modify test_faster_rcnn to adapt torch vision test Jan 15, 2021
@jiafatom jiafatom changed the title [WIP][ONNX] Modify test_faster_rcnn to adapt torch vision test [WIP][ONNX] Modify test_faster_rcnn to adopt torch vision test Jan 15, 2021
@jiafatom jiafatom changed the title [WIP][ONNX] Modify test_faster_rcnn to adopt torch vision test [WIP][ONNX] Enable _jit_pass_onnx_fold_if only when dynamic_axes is None Jan 15, 2021
@jiafatom jiafatom changed the title [WIP][ONNX] Enable _jit_pass_onnx_fold_if only when dynamic_axes is None [Waiting for build][ONNX] Enable _jit_pass_onnx_fold_if only when dynamic_axes is None Jan 15, 2021
@jiafatom jiafatom changed the title [Waiting for build][ONNX] Enable _jit_pass_onnx_fold_if only when dynamic_axes is None [ONNX] Enable _jit_pass_onnx_fold_if only when dynamic_axes is None Jan 15, 2021
Copy link
Copy Markdown
Collaborator

@BowenBao BowenBao left a comment

Choose a reason for hiding this comment

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

Could you add more info as for how fold_if pass is failing?

@jiafatom
Copy link
Copy Markdown
Contributor Author

Could you add more info as for how fold_if pass is failing?

For test_faster_rcnn, when I see the onnx model converted using dummy input, it has only one NonMaxSuppression node,
but when I see the onnx model converted using a true image, it has two NonMaxSuppression nodes.
This is because of the logic that handles differently on some conditions.
For the existing code, it does not particularly handle dynamic_axes logic, then it wants to treat the input axes as constant and do some folding. Then it gives error when I have a different input shape.

@KsenijaS
Copy link
Copy Markdown
Contributor

@jiafatom
Copy link
Copy Markdown
Contributor Author

dynamic axes are checked on this line of code: https://github.com/pytorch/pytorch/blob/master/torch/csrc/jit/passes/onnx/fold_if_node.cpp#L54

Sure. Let's check in this PR first to include the torch vision UT. For the code as mentioned, it breaks current UT, we can fix that in a separate PR.

Copy link
Copy Markdown
Contributor

@neginraoof neginraoof 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. Please follow up about the disabled pass. Thanks.

@BowenBao BowenBao merged commit 5e24665 into pytorch:onnx_ms_1 Jan 20, 2021
@jiafatom jiafatom deleted the test_faster_rcnn branch January 20, 2021 18:52
BowenBao added a commit that referenced this pull request Jan 21, 2021
…50582)

Fixing pytorch/vision#3251 (PR #49410 triggers the torch vision test build failure, on three tests test_faster_rcnn, test_mask_rcnn, test_keypoint_rcnn. )

The offending PR is fine on pytorch UT, because the torchvision and pytorch test has a gap when we merge them - we are using different test API on two sides, therefore causing some discrepancy.

This PR bridge the gap for the above three tests, and disable _jit_pass_onnx_fold_if pass until it gets fixed.
Allow _jit_pass_onnx_fold_if only when dynamic_axes is None.

[ghstack-poisoned]
BowenBao added a commit that referenced this pull request Jan 21, 2021
…s is None (#50582)"

Fixing pytorch/vision#3251 (PR #49410 triggers the torch vision test build failure, on three tests test_faster_rcnn, test_mask_rcnn, test_keypoint_rcnn. )

The offending PR is fine on pytorch UT, because the torchvision and pytorch test has a gap when we merge them - we are using different test API on two sides, therefore causing some discrepancy.

This PR bridge the gap for the above three tests, and disable _jit_pass_onnx_fold_if pass until it gets fixed.
Allow _jit_pass_onnx_fold_if only when dynamic_axes is None.

[ghstack-poisoned]
BowenBao added a commit that referenced this pull request Jan 22, 2021
…s is None (#50582)"

Fixing pytorch/vision#3251 (PR #49410 triggers the torch vision test build failure, on three tests test_faster_rcnn, test_mask_rcnn, test_keypoint_rcnn. )

The offending PR is fine on pytorch UT, because the torchvision and pytorch test has a gap when we merge them - we are using different test API on two sides, therefore causing some discrepancy.

This PR bridge the gap for the above three tests, and disable _jit_pass_onnx_fold_if pass until it gets fixed.
Allow _jit_pass_onnx_fold_if only when dynamic_axes is None.

[ghstack-poisoned]
BowenBao added a commit that referenced this pull request Jan 22, 2021
…s is None (#50582)"

Fixing pytorch/vision#3251 (PR #49410 triggers the torch vision test build failure, on three tests test_faster_rcnn, test_mask_rcnn, test_keypoint_rcnn. )

The offending PR is fine on pytorch UT, because the torchvision and pytorch test has a gap when we merge them - we are using different test API on two sides, therefore causing some discrepancy.

This PR bridge the gap for the above three tests, and disable _jit_pass_onnx_fold_if pass until it gets fixed.
Allow _jit_pass_onnx_fold_if only when dynamic_axes is None.

Differential Revision: [D26023934](https://our.internmc.facebook.com/intern/diff/D26023934)

[ghstack-poisoned]
BowenBao added a commit that referenced this pull request Jan 25, 2021
…s is None (#50582)"


Fixing pytorch/vision#3251 (PR #49410 triggers the torch vision test build failure, on three tests test_faster_rcnn, test_mask_rcnn, test_keypoint_rcnn. )

The offending PR is fine on pytorch UT, because the torchvision and pytorch test has a gap when we merge them - we are using different test API on two sides, therefore causing some discrepancy.

This PR bridge the gap for the above three tests, and disable _jit_pass_onnx_fold_if pass until it gets fixed.
Allow _jit_pass_onnx_fold_if only when dynamic_axes is None.

[ghstack-poisoned]
BowenBao added a commit that referenced this pull request Jan 25, 2021
…s is None (#50582)"


Fixing pytorch/vision#3251 (PR #49410 triggers the torch vision test build failure, on three tests test_faster_rcnn, test_mask_rcnn, test_keypoint_rcnn. )

The offending PR is fine on pytorch UT, because the torchvision and pytorch test has a gap when we merge them - we are using different test API on two sides, therefore causing some discrepancy.

This PR bridge the gap for the above three tests, and disable _jit_pass_onnx_fold_if pass until it gets fixed.
Allow _jit_pass_onnx_fold_if only when dynamic_axes is None.

Differential Revision: [D26050886](https://our.internmc.facebook.com/intern/diff/D26050886)

[ghstack-poisoned]
BowenBao added a commit that referenced this pull request Jan 26, 2021
…s is None (#50582)"


Fixing pytorch/vision#3251 (PR #49410 triggers the torch vision test build failure, on three tests test_faster_rcnn, test_mask_rcnn, test_keypoint_rcnn. )

The offending PR is fine on pytorch UT, because the torchvision and pytorch test has a gap when we merge them - we are using different test API on two sides, therefore causing some discrepancy.

This PR bridge the gap for the above three tests, and disable _jit_pass_onnx_fold_if pass until it gets fixed.
Allow _jit_pass_onnx_fold_if only when dynamic_axes is None.

Differential Revision: [D26050886](https://our.internmc.facebook.com/intern/diff/D26050886)

[ghstack-poisoned]
facebook-github-bot pushed a commit that referenced this pull request Jan 28, 2021
…50582) (#50910)

Summary:
Pull Request resolved: #50910

Fixing pytorch/vision#3251 (PR #49410 triggers the torch vision test build failure, on three tests test_faster_rcnn, test_mask_rcnn, test_keypoint_rcnn. )

The offending PR is fine on pytorch UT, because the torchvision and pytorch test has a gap when we merge them - we are using different test API on two sides, therefore causing some discrepancy.

This PR bridge the gap for the above three tests, and disable _jit_pass_onnx_fold_if pass until it gets fixed.
Allow _jit_pass_onnx_fold_if only when dynamic_axes is None.

Test Plan: Imported from OSS

Reviewed By: pbelevich

Differential Revision: D26050886

Pulled By: SplitInfinity

fbshipit-source-id: b765ffe30914261866dcc761f0d0999fd16169e3
BowenBao added a commit to BowenBao/pytorch that referenced this pull request Jan 28, 2021
…ytorch#50582)

Fixing pytorch/vision#3251 (PR pytorch#49410 triggers the torch vision test build failure, on three tests test_faster_rcnn, test_mask_rcnn, test_keypoint_rcnn. )

The offending PR is fine on pytorch UT, because the torchvision and pytorch test has a gap when we merge them - we are using different test API on two sides, therefore causing some discrepancy.

This PR bridge the gap for the above three tests, and disable _jit_pass_onnx_fold_if pass until it gets fixed.
Allow _jit_pass_onnx_fold_if only when dynamic_axes is None.

ghstack-source-id: 53b0416
Pull Request resolved: pytorch#50910
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.

6 participants