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

[inductor] fix linear add bias pattern (#128473) #128577

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

zhuhaozhe
Copy link
Collaborator

@zhuhaozhe zhuhaozhe commented Jun 13, 2024

Fix #128287. Previous the assertion in linear_add_bias are pretty bad

assert packed_weight_node.name == "_reorder_linear_weight"
assert transpose_weight_node.name == "permute_default"

because the name can be changed to _reorder_linear_weight_id, permute_default_id if we have more than 1 reorder/permute.

Check target instead name can solve this issue.

UT is also updated to have match more than 1 linear_add_bias pattern to cover this case.

Co-authored-by: Jiong Gong [email protected]
Pull Request resolved: #128473
Approved by: https://github.com/jgong5

(cherry picked from commit c53d65b)

Fixes #ISSUE_NUMBER

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang

Fix pytorch#128287.
Previous the assertion in `linear_add_bias` are pretty bad
```
assert packed_weight_node.name == "_reorder_linear_weight"
assert transpose_weight_node.name == "permute_default"
```
because the `name` can be changed to `_reorder_linear_weight_id, permute_default_id` if we have more than 1 reorder/permute.

Check `target` instead `name` can solve this issue.

UT is also updated to have match more than 1 `linear_add_bias` pattern to cover this case.

Co-authored-by: Jiong Gong <[email protected]>
Pull Request resolved: pytorch#128473
Approved by: https://github.com/jgong5

(cherry picked from commit c53d65b)
Copy link

pytorch-bot bot commented Jun 13, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/128577

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit 5f23f6d with merge base b66e3f0 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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

@atalman atalman merged commit 082c4f7 into pytorch:release/2.4 Jun 19, 2024
164 of 165 checks passed
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.

None yet

4 participants