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

[fuse_elementwise] Fix external outputs collection #848

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ymwangg
Copy link
Contributor

@ymwangg ymwangg commented Jul 26, 2023

This PR fixed a corner case where the fuse_elementwise pass may produce two external output tensors with different shapes. This subgraph pattern is seen the huggingface bert model.

…has multiple external outputs with different shapes
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 26, 2023
"""
Given an elementwise op, returns a list of parent elementwise ops
which can be fused with this elementwise op.
"""

# Get parent ops.
dependent_ops = set()
for input_tensor in op._attrs["inputs"]:
for input_tensor in src_op._attrs["inputs"]:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is to avoid a naming collision to make debug easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants