Skip to content

Conversation

@LiamZhuuu
Copy link

Summary:
As title, For instance,

We match two patterns

(add, (bn, conv), matchallnode)
(add, matchallnode, (bn, conv))

Against the model

conv1 -> bn1 |
conv2 -> bn2 + add

For the add node, both two patterns passes is_match and apply_match is executed twice. As a result, both conv1 -> bn1 and conv2 -> bn2 will be matched as (bn, conv) instead of one (bn, conv) one matchallnode.

To fix this, stop trying all the other pattners once a pattern is matched.

Test Plan: verified in D35252100

Differential Revision: D35300191

Summary:
As title, For instance,

We match two patterns
```
(add, (bn, conv), matchallnode)
(add, matchallnode, (bn, conv))
```

Against the model
```
conv1 -> bn1 |
conv2 -> bn2 + add
```

For the add node, both two patterns passes `is_match` and `apply_match` is executed twice. As a result, both `conv1 -> bn1` and `conv2 -> bn2` will be matched as `(bn, conv)` instead of one `(bn, conv)` one `matchallnode`.

To fix this, stop trying all the other pattners once a pattern is matched.

Test Plan: verified in D35252100

Differential Revision: D35300191

fbshipit-source-id: e0780802b990815d7c131bf1df6cd12a9022bd96
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Mar 31, 2022

🔗 Helpful links

💊 CI failures summary and remediations

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


  • 2/2 failures introduced in this PR

🕵️‍♀️ 2 failures not recognized by patterns:

The following CI failures may be due to changes from the PR
Job Step Action
GitHub Actions pull / linux-bionic-rocm5.0-py3.7 / test (default, 1, 2, linux.rocm.gpu) Checkout PyTorch 🔁 rerun
GitHub Actions pull / linux-bionic-rocm5.0-py3.7 / test (default, 2, 2, linux.rocm.gpu) Checkout PyTorch 🔁 rerun

This comment was automatically generated by Dr. CI (expand for details).

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

Click here to manually regenerate this comment.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D35300191

Copy link
Contributor

@jerryzh168 jerryzh168 left a comment

Choose a reason for hiding this comment

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

thanks for finding the issue and the fix!

facebook-github-bot pushed a commit that referenced this pull request Apr 1, 2022
Summary:
Pull Request resolved: #75047

As title, For instance,

We match two patterns
```
(add, (bn, conv), matchallnode)
(add, matchallnode, (bn, conv))
```

Against the model
```
conv1 -> bn1 |
conv2 -> bn2 + add
```

For the add node, both two patterns passes `is_match` and `apply_match` is executed twice. As a result, both `conv1 -> bn1` and `conv2 -> bn2` will be matched as `(bn, conv)` instead of one `(bn, conv)` one `matchallnode`.

To fix this, stop trying all the other pattners once a pattern is matched.

Test Plan: verified in D35252100

Reviewed By: jerryzh168

Differential Revision: D35300191

fbshipit-source-id: 383b2eb971d436072e1c28597c5b6a01d0f49c5a
@github-actions
Copy link
Contributor

github-actions bot commented Apr 1, 2022

Hey @LiamZhuuu.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

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.

4 participants