Skip to content

[ONNX] Add einsum export#32716

Closed
neginraoof wants to merge 6 commits intopytorch:masterfrom
neginraoof:neraoof/einsum
Closed

[ONNX] Add einsum export#32716
neginraoof wants to merge 6 commits intopytorch:masterfrom
neginraoof:neraoof/einsum

Conversation

@neginraoof
Copy link
Contributor

Adding symbolic for onnx einsum as part of opset 12

@kostmo
Copy link
Member

kostmo commented Jan 28, 2020

💊 CircleCI build failures summary and remediations

As of commit ad32141:

None of the build failures appear to be your fault.

  • 2/2 broken upstream at merge base 0dc38be since Jan 28

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

    Since your merge base is older than viable/strict, run these commands:

    git fetch origin viable/strict
    git rebase viable/strict
    

    Check out the recency history of this "viable master" tracking branch.

Detailed failure analysis

One may explore the probable reasons each build failed interactively on the Dr. CI website.

🚧 2 upstream failures recognized by patterns:

These builds matched patterns, but were probably caused by upstream breakages:


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 on the GitHub issue tracker.

This comment has been revised 9 times.

@yf225 yf225 requested a review from houseroad January 29, 2020 19:41
@yf225
Copy link
Contributor

yf225 commented Jan 29, 2020

@houseroad Please let me know if I should ask someone else to review it. Thanks!

Copy link
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.

@yf225 yf225 added module: onnx Related to torch.onnx triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Jan 29, 2020
Copy link
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, thanks.


@parse_args('s', 'v')
def einsum(g, equation, tensor_list):
return g.op("Einsum", tensor_list, equation_s=equation)
Copy link
Member

Choose a reason for hiding this comment

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

How do we handle tensor_list here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I missed that. I fixed the symbolic and checked on onnx graph.

Copy link
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.

Actually, tests are failing. Is it related?

Copy link
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.

@neginraoof
Copy link
Contributor Author

Actually, tests are failing. Is it related?
@houseroad Thanks.
Torchvision tests failed for ORT backend opset 12 tests. This is beacuse torchvision custom ops are registered as part of opset 11 only. I'll disabled those tests for opset 12. I'm going to send a fix for this in another PR.

Copy link
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.

@facebook-github-bot
Copy link
Contributor

@houseroad merged this pull request in e03e4f3.

BowenBao pushed a commit to BowenBao/pytorch that referenced this pull request Feb 12, 2020
Summary:
Adding symbolic for onnx einsum as part of opset 12
Pull Request resolved: pytorch#32716

Reviewed By: hl475

Differential Revision: D19626168

Pulled By: houseroad

fbshipit-source-id: d8cc8af5f05f36aca3cd55dead602261ccdfec51
ttumiel pushed a commit to ttumiel/pytorch that referenced this pull request Mar 4, 2020
Summary:
Adding symbolic for onnx einsum as part of opset 12
Pull Request resolved: pytorch#32716

Reviewed By: hl475

Differential Revision: D19626168

Pulled By: houseroad

fbshipit-source-id: d8cc8af5f05f36aca3cd55dead602261ccdfec51
@tygrer
Copy link

tygrer commented Mar 19, 2020

I still cannot convert model from pytorch to onnx. Even though I has altered the source code of
symbolic_opset12.py and symbolic_helper.py. The op of einsum is still not be recognized.
File "/home/tanggy/anaconda3/envs/grab/lib/python3.6/site-packages/torch/onnx/init.py", line 148, in export
strip_doc_string, dynamic_axes, keep_initializers_as_inputs)
File "/home/tanggy/anaconda3/envs/grab/lib/python3.6/site-packages/torch/onnx/utils.py", line 66, in export
dynamic_axes=dynamic_axes, keep_initializers_as_inputs=keep_initializers_as_inputs)
File "/home/tanggy/anaconda3/envs/grab/lib/python3.6/site-packages/torch/onnx/utils.py", line 416, in _export
fixed_batch_size=fixed_batch_size)
File "/home/tanggy/anaconda3/envs/grab/lib/python3.6/site-packages/torch/onnx/utils.py", line 296, in _model_to_graph
fixed_batch_size=fixed_batch_size, params_dict=params_dict)
File "/home/tanggy/anaconda3/envs/grab/lib/python3.6/site-packages/torch/onnx/utils.py", line 135, in _optimize_graph
graph = torch._C._jit_pass_onnx(graph, operator_export_type)
File "/home/tanggy/anaconda3/envs/grab/lib/python3.6/site-packages/torch/onnx/init.py", line 179, in _run_symbolic_function
return utils._run_symbolic_function(*args, **kwargs)
File "/home/tanggy/anaconda3/envs/grab/lib/python3.6/site-packages/torch/onnx/utils.py", line 656, in _run_symbolic_function
op_fn = sym_registry.get_registered_op(op_name, '', opset_version)
File "/home/tanggy/anaconda3/envs/grab/lib/python3.6/site-packages/torch/onnx/symbolic_registry.py", line 91, in get_registered_op
return _registry[(domain, version)][opname]
KeyError: 'einsum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: onnx Related to torch.onnx open source triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants