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

[Quant][PT2E] Enable weight scale optimization in QConv PT2E #105996

Conversation

leslie-fang-intel
Copy link
Collaborator

@leslie-fang-intel leslie-fang-intel commented Jul 26, 2023

Stack from ghstack (oldest at bottom):

Summary
After oneDNN 3.1 upgrade, we don't need to do the weight scale reciprocal calculation. So, remove the redundant reciprocal calculation to optimize QConv performance and using IDeep version API to implement it in this PR:

cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @gujinghui @PenghuiCheng @jianyuh @min-jean-cho @yanbing-j @Guobing-Chen @Xia-Weiwen

@pytorch-bot
Copy link

pytorch-bot bot commented Jul 26, 2023

🔗 Helpful Links

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

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

✅ No Failures

As of commit 430294f with merge base 97a291f (image):
💚 Looks good so far! There are no failures yet. 💚

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

@pytorch-bot pytorch-bot bot added the release notes: quantization release notes category label Jul 26, 2023
@leslie-fang-intel leslie-fang-intel marked this pull request as draft July 26, 2023 02:21
leslie-fang-intel added a commit that referenced this pull request Jul 26, 2023
ghstack-source-id: 05dcbc7472ef4573dde8c06e4bd8d6b0c9ee76f7
Pull Request resolved: #105996
@leslie-fang-intel leslie-fang-intel changed the title enabel weight scale optimization [Test Only] Enable weight scale optimization in QConv PT2E Jul 26, 2023
@leslie-fang-intel leslie-fang-intel added the ciflow/trunk Trigger trunk jobs on your pull request label Jul 26, 2023
leslie-fang-intel added a commit that referenced this pull request Jul 26, 2023
ghstack-source-id: 7455c3a56d6ef5cd25a5a03df06fd65467dbf689
Pull Request resolved: #105996
@github-actions github-actions bot added module: cpu CPU specific problem (e.g., perf, algorithm) module: mkldnn Related to Intel IDEEP or oneDNN (a.k.a. mkldnn) integration labels Jul 26, 2023
leslie-fang-intel added a commit that referenced this pull request Jul 26, 2023
ghstack-source-id: b60eea67f24668eb4269380fb1254e9d013f24e7
Pull Request resolved: #105996
cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 gujinghui PenghuiCheng jianyuh min-jean-cho yanbing-j Guobing-Chen Xia-Weiwen

[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this pull request Aug 23, 2023
…ndant QConv weight scale reciprocal calculation"


**Summary**
Upgrade IDeep which includes 2 IDeep change as IDeep PR: intel/ideep#222 and intel/ideep#223

- For IDeep PR: intel/ideep#222 which has done 2 things:

  - Remove the redundant QConv weight scale reciprocal calculation.
  - Pump IDEEP_VERSION_REVISION version from 0 to 1.
  
  So only QConv related calculation will be impacted and we already use IDeep version API in #105996 to make the corresponding change in PyTorch.

- For IDeep PR: intel/ideep#223 which includes AArch64 specific changes with the oneDNN 3.1.1 upgrade.


cc gujinghui PenghuiCheng XiaobingSuper jianyuh jgong5 mingfeima sanchitintel ashokei jingxu10 min-jean-cho yanbing-j Guobing-Chen Xia-Weiwen

[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this pull request Aug 23, 2023
…ht scale reciprocal calculation"


**Summary**
Upgrade IDeep which includes 2 IDeep change as IDeep PR: intel/ideep#222 and intel/ideep#223

- For IDeep PR: intel/ideep#222 which has done 2 things:

  - Remove the redundant QConv weight scale reciprocal calculation.
  - Pump IDEEP_VERSION_REVISION version from 0 to 1.
  
  So only QConv related calculation will be impacted and we already use IDeep version API in #105996 to make the corresponding change in PyTorch.

- For IDeep PR: intel/ideep#223 which includes AArch64 specific changes with the oneDNN 3.1.1 upgrade.


cc gujinghui PenghuiCheng XiaobingSuper jianyuh jgong5 mingfeima sanchitintel ashokei jingxu10 min-jean-cho yanbing-j Guobing-Chen Xia-Weiwen

[ghstack-poisoned]
**Summary**
After oneDNN 3.1 upgrade, we don't need to do the weight scale reciprocal calculation. So, remove the redundant reciprocal calculation to optimize QConv performance and using IDeep version API to implement it in this PR:

- This QConv implementation expects to work functionally both with current IDeep version and the following IDeep upgrade in PR: #107565.
- With the following IDeep upgrade in PR: #107565, the QConv has better performance since the redundant reciprocal calculation are removed.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 gujinghui PenghuiCheng jianyuh min-jean-cho yanbing-j Guobing-Chen Xia-Weiwen

[ghstack-poisoned]
leslie-fang-intel added a commit to leslie-fang-intel/pytorch that referenced this pull request Aug 25, 2023
ghstack-source-id: 2e5ddcd8b1e64d459b1934ff16469e6cb8feb8a5
Pull Request resolved: pytorch#105996
leslie-fang-intel added a commit that referenced this pull request Aug 25, 2023
…ndant QConv weight scale reciprocal calculation"


**Summary**
Upgrade IDeep which includes 1 IDeep change as IDeep PR: intel/ideep#226 

- For IDeep PR: intel/ideep#226 which has done 2 things:

  - Remove the redundant QConv weight scale reciprocal calculation.
  - Pump IDEEP_VERSION_REVISION version from 0 to 1.
  
  So only QConv related calculation will be impacted and we already use IDeep version API in #105996 to make the corresponding change in PyTorch.


cc gujinghui PenghuiCheng XiaobingSuper jianyuh jgong5 mingfeima sanchitintel ashokei jingxu10 min-jean-cho yanbing-j Guobing-Chen Xia-Weiwen

[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this pull request Aug 25, 2023
…ht scale reciprocal calculation"


**Summary**
Upgrade IDeep which includes 1 IDeep change as IDeep PR: intel/ideep#226 

- For IDeep PR: intel/ideep#226 which has done 2 things:

  - Remove the redundant QConv weight scale reciprocal calculation.
  - Pump IDEEP_VERSION_REVISION version from 0 to 1.
  
  So only QConv related calculation will be impacted and we already use IDeep version API in #105996 to make the corresponding change in PyTorch.


cc gujinghui PenghuiCheng XiaobingSuper jianyuh jgong5 mingfeima sanchitintel ashokei jingxu10 min-jean-cho yanbing-j Guobing-Chen Xia-Weiwen

[ghstack-poisoned]
**Summary**
After oneDNN 3.1 upgrade, we don't need to do the weight scale reciprocal calculation. So, remove the redundant reciprocal calculation to optimize QConv performance and using IDeep version API to implement it in this PR:

- This QConv implementation expects to work functionally both with current IDeep version and the following IDeep upgrade in PR: #107565.
- With the following IDeep upgrade in PR: #107565, the QConv has better performance since the redundant reciprocal calculation are removed.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 gujinghui PenghuiCheng jianyuh min-jean-cho yanbing-j Guobing-Chen Xia-Weiwen

[ghstack-poisoned]
leslie-fang-intel added a commit to leslie-fang-intel/pytorch that referenced this pull request Aug 25, 2023
ghstack-source-id: 6888c85b439a646fa3994a643162da995b82bb67
Pull Request resolved: pytorch#105996
leslie-fang-intel added a commit that referenced this pull request Aug 25, 2023
…remove redundant QConv weight scale reciprocal calculation"


**Summary**
Upgrade IDeep which includes 1 IDeep change as IDeep PR: intel/ideep#226 

- For IDeep PR: intel/ideep#226 which has done 2 things:

  - Remove the redundant QConv weight scale reciprocal calculation.
  - Pump IDEEP_VERSION_REVISION version from 0 to 1.
  
  So only QConv related calculation will be impacted and we already use IDeep version API in #105996 to make the corresponding change in PyTorch.


cc gujinghui PenghuiCheng XiaobingSuper jianyuh jgong5 mingfeima sanchitintel ashokei jingxu10 min-jean-cho yanbing-j Guobing-Chen Xia-Weiwen

[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this pull request Aug 25, 2023
… QConv weight scale reciprocal calculation"


**Summary**
Upgrade IDeep which includes 1 IDeep change as IDeep PR: intel/ideep#226 

- For IDeep PR: intel/ideep#226 which has done 2 things:

  - Remove the redundant QConv weight scale reciprocal calculation.
  - Pump IDEEP_VERSION_REVISION version from 0 to 1.
  
  So only QConv related calculation will be impacted and we already use IDeep version API in #105996 to make the corresponding change in PyTorch.


cc gujinghui PenghuiCheng XiaobingSuper jianyuh jgong5 mingfeima sanchitintel ashokei jingxu10 min-jean-cho yanbing-j Guobing-Chen Xia-Weiwen

[ghstack-poisoned]
**Summary**
After oneDNN 3.1 upgrade, we don't need to do the weight scale reciprocal calculation. So, remove the redundant reciprocal calculation to optimize QConv performance and using IDeep version API to implement it in this PR:

- This QConv implementation expects to work functionally both with current IDeep version and the following IDeep upgrade in PR: #107565.
- With the following IDeep upgrade in PR: #107565, the QConv has better performance since the redundant reciprocal calculation are removed.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 gujinghui PenghuiCheng jianyuh min-jean-cho yanbing-j Guobing-Chen Xia-Weiwen

[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this pull request Aug 25, 2023
…remove redundant QConv weight scale reciprocal calculation"


**Summary**
Upgrade IDeep which includes 1 IDeep change as IDeep PR: intel/ideep#226 

- For IDeep PR: intel/ideep#226 which has done 2 things:

  - Remove the redundant QConv weight scale reciprocal calculation.
  - Pump IDEEP_VERSION_REVISION version from 0 to 1.
  
  So only QConv related calculation will be impacted and we already use IDeep version API in #105996 to make the corresponding change in PyTorch.


cc gujinghui PenghuiCheng XiaobingSuper jianyuh jgong5 mingfeima sanchitintel ashokei jingxu10 min-jean-cho yanbing-j Guobing-Chen Xia-Weiwen

[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this pull request Aug 25, 2023
… QConv weight scale reciprocal calculation"


**Summary**
Upgrade IDeep which includes 1 IDeep change as IDeep PR: intel/ideep#226 

- For IDeep PR: intel/ideep#226 which has done 2 things:

  - Remove the redundant QConv weight scale reciprocal calculation.
  - Pump IDEEP_VERSION_REVISION version from 0 to 1.
  
  So only QConv related calculation will be impacted and we already use IDeep version API in #105996 to make the corresponding change in PyTorch.


cc gujinghui PenghuiCheng XiaobingSuper jianyuh jgong5 mingfeima sanchitintel ashokei jingxu10 min-jean-cho yanbing-j Guobing-Chen Xia-Weiwen

[ghstack-poisoned]
**Summary**
After oneDNN 3.1 upgrade, we don't need to do the weight scale reciprocal calculation. So, remove the redundant reciprocal calculation to optimize QConv performance and using IDeep version API to implement it in this PR:

- This QConv implementation expects to work functionally both with current IDeep version and the following IDeep upgrade in PR: #107565.
- With the following IDeep upgrade in PR: #107565, the QConv has better performance since the redundant reciprocal calculation are removed.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 gujinghui PenghuiCheng jianyuh min-jean-cho yanbing-j Guobing-Chen Xia-Weiwen

[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this pull request Aug 25, 2023
…remove redundant QConv weight scale reciprocal calculation"


**Summary**
Upgrade IDeep which includes 1 IDeep change as IDeep PR: intel/ideep#226 

- For IDeep PR: intel/ideep#226 which has done 2 things:

  - Remove the redundant QConv weight scale reciprocal calculation.
  - Pump IDEEP_VERSION_REVISION version from 0 to 1.
  
  So only QConv related calculation will be impacted and we already use IDeep version API in #105996 to make the corresponding change in PyTorch.


cc gujinghui PenghuiCheng XiaobingSuper jianyuh jgong5 mingfeima sanchitintel ashokei jingxu10 min-jean-cho yanbing-j Guobing-Chen Xia-Weiwen

[ghstack-poisoned]
leslie-fang-intel added a commit that referenced this pull request Aug 25, 2023
… QConv weight scale reciprocal calculation"


**Summary**
Upgrade IDeep which includes 1 IDeep change as IDeep PR: intel/ideep#226 

- For IDeep PR: intel/ideep#226 which has done 2 things:

  - Remove the redundant QConv weight scale reciprocal calculation.
  - Pump IDEEP_VERSION_REVISION version from 0 to 1.
  
  So only QConv related calculation will be impacted and we already use IDeep version API in #105996 to make the corresponding change in PyTorch.


cc gujinghui PenghuiCheng XiaobingSuper jianyuh jgong5 mingfeima sanchitintel ashokei jingxu10 min-jean-cho yanbing-j Guobing-Chen Xia-Weiwen

[ghstack-poisoned]
**Summary**
After oneDNN 3.1 upgrade, we don't need to do the weight scale reciprocal calculation. So, remove the redundant reciprocal calculation to optimize QConv performance and using IDeep version API to implement it in this PR:

- This QConv implementation expects to work functionally both with current IDeep version and the following IDeep upgrade in PR: #107565.
- With the following IDeep upgrade in PR: #107565, the QConv has better performance since the redundant reciprocal calculation are removed.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 gujinghui PenghuiCheng jianyuh min-jean-cho yanbing-j Guobing-Chen Xia-Weiwen

[ghstack-poisoned]
@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

pytorchmergebot pushed a commit that referenced this pull request Aug 26, 2023
…ht scale reciprocal calculation (#107565)

**Summary**
Upgrade IDeep which includes 1 IDeep change as IDeep PR: intel/ideep#226

- For IDeep PR: intel/ideep#226 which has done 2 things:

  - Remove the redundant QConv weight scale reciprocal calculation.
  - Pump IDEEP_VERSION_REVISION version from 0 to 1.

  So only QConv related calculation will be impacted and we already use IDeep version API in #105996 to make the corresponding change in PyTorch.

Pull Request resolved: #107565
Approved by: https://github.com/jgong5, https://github.com/jerryzh168
ghstack dependencies: #104580, #104581, #104588, #104590, #105455, #105456, #105639, #105906, #105996
voznesenskym pushed a commit that referenced this pull request Aug 27, 2023
**Summary**
After oneDNN 3.1 upgrade, we don't need to do the weight scale reciprocal calculation. So, remove the redundant reciprocal calculation to optimize QConv performance and using IDeep version API to implement it in this PR:

- This QConv implementation expects to work functionally both with current IDeep version and the following IDeep upgrade in PR: #107565.
- With the following IDeep upgrade in PR: #107565, the QConv has better performance since the redundant reciprocal calculation are removed.

Pull Request resolved: #105996
Approved by: https://github.com/jgong5, https://github.com/jerryzh168
ghstack dependencies: #104580, #104581, #104588, #104590, #105455, #105456, #105639, #105906
voznesenskym pushed a commit that referenced this pull request Aug 27, 2023
…ht scale reciprocal calculation (#107565)

**Summary**
Upgrade IDeep which includes 1 IDeep change as IDeep PR: intel/ideep#226

- For IDeep PR: intel/ideep#226 which has done 2 things:

  - Remove the redundant QConv weight scale reciprocal calculation.
  - Pump IDEEP_VERSION_REVISION version from 0 to 1.

  So only QConv related calculation will be impacted and we already use IDeep version API in #105996 to make the corresponding change in PyTorch.

Pull Request resolved: #107565
Approved by: https://github.com/jgong5, https://github.com/jerryzh168
ghstack dependencies: #104580, #104581, #104588, #104590, #105455, #105456, #105639, #105906, #105996
@facebook-github-bot facebook-github-bot deleted the gh/leslie-fang-intel/63/head branch August 29, 2023 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request Merged module: cpu CPU specific problem (e.g., perf, algorithm) module: mkldnn Related to Intel IDEEP or oneDNN (a.k.a. mkldnn) integration open source release notes: quantization release notes category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants