Skip to content

Conversation

justinchuby
Copy link
Collaborator

@justinchuby justinchuby commented Apr 17, 2023

πŸ€– Generated by Copilot at d490881

Summary

πŸ“¦πŸš€πŸ—ΊοΈ

This pull request adds support for converting more PyTorch FX operators to ONNX using the onnxscript package. It updates the package installation script and the operator mappings in function_dispatcher.py. It also enables a test case for the max_pool2d operator.

We unleash the fury of the ONNX script
We break the chains of the skipped test
We map the functions of the ATen torch
We forge the metal of the ONNX forge

Walkthrough

  • Fix and update the installation of the onnxscript package (link)
  • Add more mappings from PyTorch ATen operators to ONNX operators in the _ATENLIB_FUNCTIONS dictionary in the function_dispatcher.py module (link, link, link, link, link)
  • Enable the test_max_pool2d method in the TestFxToOnnx class in the test_fx_to_onnx.py file, since the max_pool2d operator is now supported by the onnxscript package (link)

@pytorch-bot
Copy link

pytorch-bot bot commented Apr 17, 2023

πŸ”— Helpful Links

πŸ§ͺ See artifacts and rendered test results at hud.pytorch.org/pr/99284

Note: Links to docs will display an error until the docs builds have been completed.

❌ 4 Failures

As of commit d68419f:

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the release notes: onnx torch.onnx related changes that should show up in the release notes label Apr 17, 2023
@justinchuby justinchuby added module: onnx Related to torch.onnx and removed release notes: onnx torch.onnx related changes that should show up in the release notes labels Apr 17, 2023
@justinchuby

This comment was marked as resolved.

@justinchuby
Copy link
Collaborator Author

Requires microsoft/onnxscript#645

@pytorch-bot pytorch-bot bot added the release notes: onnx torch.onnx related changes that should show up in the release notes label Apr 17, 2023
justinchuby added a commit to microsoft/onnxscript that referenced this pull request Apr 20, 2023
Previously it was passed in as an empty list and graph_builder fails
when the list is empty.

Discovered in pytorch/pytorch#99284

- Added maxpool_2d/3d custom OpInfo tests. Skipping 3d for now due to
shape mismatch.
- Pin torch-nightly version to a requirements file
@justinchuby justinchuby marked this pull request as ready for review April 20, 2023 22:37
Copy link
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.

LGTM, mergeable after consensus with @titaiwangms on test_mnist I guess?

@justinchuby
Copy link
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Apr 22, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@justinchuby
Copy link
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: Approval needed from one of the following:
khabinov, c-odrin, sgrigory, xunnanxu, xing-liu, ...

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@justinchuby
Copy link
Collaborator Author

@pytorchbot -h

@pytorch-bot
Copy link

pytorch-bot bot commented Apr 25, 2023

PyTorchBot Help

usage: @pytorchbot [-h] {merge,revert,rebase,label,drci} ...

In order to invoke the bot on your PR, include a line that starts with
@pytorchbot anywhere in a comment. That line will form the command; no
multi-line commands are allowed. 

Example:
    Some extra context, blah blah, wow this PR looks awesome

    @pytorchbot merge

optional arguments:
  -h, --help            Show this help message and exit.

command:
  {merge,revert,rebase,label,drci}
    merge               Merge a PR
    revert              Revert a PR
    rebase              Rebase a PR
    label               Add label to a PR
    drci                Update Dr. CI

Merge

usage: @pytorchbot merge [-f MESSAGE | -ic] [-r [{viable/strict,main}]]

Merge an accepted PR, subject to the rules in .github/merge_rules.json.
By default, this will wait for all required checks (lint, pull) to succeed before merging.

optional arguments:
  -f MESSAGE, --force MESSAGE
                        Merge without checking anything. This requires a reason for auditting purpose, for example:
                        @pytorchbot merge -f 'Minor update to fix lint. Expecting all PR tests to pass'
  -ic, --ignore-current
                        Merge while ignore the currently failing jobs.  If there are no pending checks, use -f/--force since this will fail.
  -r [{viable/strict,main}], --rebase [{viable/strict,main}]
                        Rebase the PR to re run checks before merging.  Accepts viable/strict or main as branch options and will default to viable/strict if not specified.

Revert

usage: @pytorchbot revert -m MESSAGE -c
                          {nosignal,ignoredsignal,landrace,weird,ghfirst}

Revert a merged PR. This requires that you are a Meta employee.

Example:
  @pytorchbot revert -m="This is breaking tests on trunk. hud.pytorch.org/" -c=nosignal

optional arguments:
  -m MESSAGE, --message MESSAGE
                        The reason you are reverting, will be put in the commit message. Must be longer than 3 words.
  -c {nosignal,ignoredsignal,landrace,weird,ghfirst}, --classification {nosignal,ignoredsignal,landrace,weird,ghfirst}
                        A machine-friendly classification of the revert reason.

Rebase

usage: @pytorchbot rebase [-s | -b BRANCH]

Rebase a PR. Rebasing defaults to the stable viable/strict branch of pytorch.
You must have write permissions to the repo to rebase a PR.

optional arguments:
  -s, --stable          [DEPRECATED] Rebase onto viable/strict
  -b BRANCH, --branch BRANCH
                        Branch you would like to rebase to

Label

usage: @pytorchbot label labels [labels ...]

Adds label to a PR

positional arguments:
  labels  Labels to add to given Pull Request

Dr CI

usage: @pytorchbot drci 

Update Dr. CI. Updates the Dr. CI comment on the PR in case it's gotten out of sync with actual CI results.

@justinchuby
Copy link
Collaborator Author

@pytorchbot merge -ic

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged while ignoring the following 4 checks: linux-binary-manywheel / manywheel-py3_8-cuda11_7-with-pypi-cudnn-build / build, linux-binary-manywheel / manywheel-py3_8-cuda12_1-build / build, linux-binary-manywheel / manywheel-py3_8-cuda11_7-with-pypi-cudnn-test, linux-binary-manywheel / manywheel-py3_8-cuda12_1-test

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@justinchuby
Copy link
Collaborator Author

@pytorchbot merge -f "onnx checks succeeded"

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@justinchuby justinchuby deleted the justinchu/maxpool branch April 25, 2023 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request Merged module: onnx Related to torch.onnx open source release notes: onnx torch.onnx related changes that should show up in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants