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

[ONNX] RNN scripting (#57564) #58576

Closed
wants to merge 1 commit into from

Conversation

BowenBao
Copy link
Collaborator

@BowenBao BowenBao commented May 19, 2021

Stack from ghstack:

Note the first commit in this PR has its own pull request here since it seemed self-contained:
#57082

  • [ONNX] simplify batch_first logic in RNN tests

  • [ONNX] support GRU with packed input in scripting mode

This required two changes:

  • Add as_tensor to symbolic_opset9.py
  • Change torch::jit::pushPackingPastRnn to recognize and properly
    replace another use of the batch_sizes output of prim::PackPadded.
    Previously the code assumed that the first use was as input to the
    RNN operator. However in some cases, it is also used to compute
    max_batch_size. For example in this code:
    https://github.com/pytorch/pytorch/blob/febff45/torch/nn/modules/rnn.py#L815-L815

With these changes the GRU tests now pass in scripting mode for opset
version >= 11.

Co-authored-by: Gary Miguel garymiguel@microsoft.com

Note the first commit in this PR has its own pull request here since it seemed self-contained:
#57082

* [ONNX] simplify batch_first logic in RNN tests

* [ONNX] support GRU with packed input in scripting mode

This required two changes:
* Add as_tensor to symbolic_opset9.py
* Change torch::jit::pushPackingPastRnn to recognize and properly
  replace another use of the batch_sizes output of prim::PackPadded.
  Previously the code assumed that the first use was as input to the
  RNN operator. However in some cases, it is also used to compute
  max_batch_size. For example in this code:
  https://github.com/pytorch/pytorch/blob/febff45/torch/nn/modules/rnn.py#L815-L815

With these changes the GRU tests now pass in scripting mode for opset
version >= 11.

Co-authored-by: Gary Miguel <garymiguel@microsoft.com>

[ghstack-poisoned]
@facebook-github-bot facebook-github-bot added oncall: jit Add this issue/PR to JIT oncall triage queue cla signed labels May 19, 2021
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented May 19, 2021

💊 CI failures summary and remediations

As of commit 352ab7f (more details on the Dr. CI page):


None of the CI failures appear to be your fault 💚



🚧 2 fixed upstream failures:

These were probably caused by upstream breakages that were already fixed.

Please rebase on the viable/strict branch (expand for instructions)

If your commit is older than viable/strict, run these commands:

git fetch https://github.com/pytorch/pytorch viable/strict
git rebase FETCH_HEAD

This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed oncall: jit Add this issue/PR to JIT oncall triage queue open source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants