Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[MKLDNN] Remove overhead of sg_mkldnn_fullyconnected op #17707

Merged
merged 1 commit into from
Mar 9, 2020

Conversation

ciyongch
Copy link
Contributor

Description

This PR is mainly focus on removing the overhead of sg_mkldnn_fullyconnected especially in the case of channel-wise quantization mode (no much change for FP32 or tensor-wise quantization mode) described in #17705, via removing extra condition check in the current logic (weights version and calibrated data value), but leaving an ENV of MXNET_MKLDNN_QFC_DYNAMIC_PARAMS for the scenario of changing those values on the fly (we don't meet such usage but in case there is).

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Feature1, tests, (and when applicable, API doc)
  • Feature2, tests, (and when applicable, API doc)

Comments

if (initialized_ && mkldnn_param.quantized) {
if (channel_wise) {
if (initialized_ && mkldnn_param.quantized &&
dmlc::GetEnv("MXNET_MKLDNN_QFC_DYNAMIC_PARAMS", 0)) {
Copy link
Member

Choose a reason for hiding this comment

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

Is this new?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think this env var could be removed in the future once the time consuming operation of weight_ver_ != weight.version() is resolved.

@ciyongch
Copy link
Contributor Author

ciyongch commented Mar 4, 2020

@TaoLv @eric-haibin-lin please take a look. CI is not that stable...

CPU Performance and Quantization automation moved this from In progress to Reviewer approved Mar 9, 2020
@pengzhao-intel pengzhao-intel merged commit 752461d into apache:master Mar 9, 2020
CPU Performance and Quantization automation moved this from Reviewer approved to Done Mar 9, 2020
MoisesHer pushed a commit to MoisesHer/incubator-mxnet that referenced this pull request Apr 10, 2020
ciyongch added a commit to ciyongch/incubator-mxnet that referenced this pull request Apr 13, 2020
ciyongch added a commit to ciyongch/incubator-mxnet that referenced this pull request Apr 16, 2020
anirudh2290 pushed a commit to anirudh2290/mxnet that referenced this pull request May 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants