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

[AO][Inductor] Enable WOQ fusion pattern with permute #135928

Conversation

leslie-fang-intel
Copy link
Collaborator

@leslie-fang-intel leslie-fang-intel commented Sep 13, 2024

Stack from ghstack (oldest at bottom):

Summary
Fix #135831 and pytorch/ao#890. The root cause of the numerical failure was that the customized woq-int8 kernel was not triggered due to changes in the pattern. After re-adding the fusion pattern, the accuracy check now passes. I will open a separate TorchAO PR to enable these unit tests in TorchAO.

Test Plan

python test/inductor/test_mkldnn_pattern_matcher.py -k test_woq_int8

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

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Sep 13, 2024

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit 335c2fb with merge base failed to retrieve merge base, please contact dev infra:
💚 Looks good so far! There are no failures yet. 💚

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

leslie-fang-intel added a commit that referenced this pull request Sep 13, 2024
ghstack-source-id: 7e1c0a42d50e4e209cb717e1f8da5eb9b76214af
Pull Request resolved: #135928
[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this pull request Sep 13, 2024
ghstack-source-id: 4cf984347939a0842b7b618a6613600c06e32dee
Pull Request resolved: #135928
@leslie-fang-intel leslie-fang-intel added ciflow/trunk Trigger trunk jobs on your pull request topic: not user facing topic category labels Sep 13, 2024
[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this pull request Sep 13, 2024
ghstack-source-id: 68ae4d478336c580a4d3fb036a2c27f5439f681f
Pull Request resolved: #135928
leslie-fang-intel added a commit that referenced this pull request Sep 13, 2024
ghstack-source-id: 68ae4d478336c580a4d3fb036a2c27f5439f681f
Pull Request resolved: #135928
@leslie-fang-intel
Copy link
Collaborator Author

cc @Valentine233 @Xia-Weiwen we also need to audit of the WOQ patterns in current lowering passes to check if they are still needed.

[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this pull request Sep 13, 2024
ghstack-source-id: 662d6f45e609e018b284c479fad2fc4e793dce3b
Pull Request resolved: #135928
@leslie-fang-intel
Copy link
Collaborator Author

Adding the TorchAO PR: pytorch/ao#884

[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this pull request Sep 13, 2024
ghstack-source-id: f884b7a90495c2b64f9fb690119c0ab30c57c96c
Pull Request resolved: #135928
@leslie-fang-intel
Copy link
Collaborator Author

leslie-fang-intel commented Sep 14, 2024

Hi @bdhirsh @jerryzh168, could you help to take a look of this PR? It should resolve the TorchAO CPU woq int8 UT numerical issue.

@bdhirsh
Copy link
Contributor

bdhirsh commented Sep 17, 2024

@eellison who would be a good person to review the inductor bits?

@leslie-fang-intel
Copy link
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Chao1Han pushed a commit to Chao1Han/pytorch that referenced this pull request Sep 20, 2024
**Summary**
Fix pytorch#135831 and pytorch/ao#890. The root cause of the numerical failure was that the customized woq-int8 kernel was not triggered due to changes in the pattern. After re-adding the fusion pattern, the accuracy check now passes. I will open a separate TorchAO PR to enable these unit tests in TorchAO.

**Test Plan**
```
python test/inductor/test_mkldnn_pattern_matcher.py -k test_woq_int8
```

Pull Request resolved: pytorch#135928
Approved by: https://github.com/jgong5, https://github.com/eellison
@github-actions github-actions bot deleted the gh/leslie-fang-intel/148/head branch October 18, 2024 02:05
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.

6 participants