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

Fix build issue with USE_CUDNN=0 #11470

Merged
merged 23 commits into from
Jul 12, 2018
Merged

Conversation

anirudh2290
Copy link
Member

Description

This was found during the flaky test investigation #10973 . I found that the windows code path is different from linux, so it was testing the MXNet conv and deconv op which was not being tested for linux. Building with USE_CUDNN=0 and USE_CUDA=1 was failing and I have added the fix here. I have also added the build and test as a stage to jenkins. Not sure if there was a reason to not check this in CI (configuration not supported by some ops etc.)

@marcoabreu

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 http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best 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 this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

Jenkinsfile Outdated
}
}
},
'Python3: MKLDNN-GPU-NOCUDNN': {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it needed to test python2 and python3 or is one enough?

Copy link
Member Author

Choose a reason for hiding this comment

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

one is enough , i will remove python2.

Jenkinsfile Outdated
ws('workspace/build-mkldnn-gpu-nocudnn') {
timeout(time: max_time, unit: 'MINUTES') {
init_git()
docker_run('ubuntu_build_cuda', 'build_ubuntu_gpu_mkldnn_cuda', false)
Copy link
Contributor

Choose a reason for hiding this comment

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

supposed to be build_ubuntu_gpu_mkldnn_nocudnn?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch! will fix.


make \
DEV=1 \
USE_CPP_PACKAGE=1 \
Copy link
Contributor

Choose a reason for hiding this comment

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

No need for the cpp package here since we don't run the cpp tests

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure about this . shouldnt we test if it builds fine with CUDNN with CPP_PACKAGE just in case cpp package depends on the flag to use cudnn specific functionality (unlikely) ?

Copy link
Contributor

Choose a reason for hiding this comment

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

The CPP package just generates wrappers around the C-API and should not rely on backend-specific things like CUDA or CUDNN. Thus, I'd say that we should keep it separate and only build the CPP package if we're actually going to run it (which we do in another test)

Copy link
Member Author

Choose a reason for hiding this comment

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

okay, removed!

Copy link
Contributor

@marcoabreu marcoabreu left a comment

Choose a reason for hiding this comment

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

Lgtm besides the cpp package

Copy link
Member

@szha szha left a comment

Choose a reason for hiding this comment

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

CI failure seems to be caused by the assumption that GPU CI runs all have cudnn enabled. Could you propose a fix for that?

@anirudh2290
Copy link
Member Author

@szha Yep, planning to fix that.

@anirudh2290 anirudh2290 changed the title Fix build issue with USE_CUDNN=0 [WIP] Fix build issue with USE_CUDNN=0 Jul 2, 2018
@anirudh2290
Copy link
Member Author

the spatial transformer op seems to be a blocker with a bunch of issues when cudnn disabled: #11568. I am currently hiding the assertion error for this op and triggering ci again. Need to stop hiding the assertion error when the issues with the op are resolved: #11568.

@anirudh2290 anirudh2290 changed the title [WIP] Fix build issue with USE_CUDNN=0 Fix build issue with USE_CUDNN=0 Jul 6, 2018
@anirudh2290
Copy link
Member Author

The two issues : #11568 and #11588 summarize the ops that are not tested and errors hidden for cuDNN disabled. I think it is okay to ignore these ops testing for cudnn disabled for now. This PR should be good to go. Removing WIP. Please help review.

* \param curr returns the current status.
* \return 0 when success, -1 when failure happens
*/
MXNET_DLL int MXCUDNNIsEnabled(bool* curr);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't add CAPI for this.
Add a environment variable if you need it for testing

@anirudh2290 anirudh2290 changed the title Fix build issue with USE_CUDNN=0 [WIP] Fix build issue with USE_CUDNN=0 Jul 10, 2018
@marcoabreu
Copy link
Contributor

We have to take care of conflicting changes when merging this PR and #11630.

@marcoabreu marcoabreu mentioned this pull request Jul 11, 2018
5 tasks
@anirudh2290
Copy link
Member Author

I have resolved the conflicts and addressed the comments on #11630

Copy link
Contributor

@marcoabreu marcoabreu left a comment

Choose a reason for hiding this comment

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

Lgtm, thanks a lot!

@anirudh2290 anirudh2290 changed the title [WIP] Fix build issue with USE_CUDNN=0 Fix build issue with USE_CUDNN=0 Jul 12, 2018
@anirudh2290 anirudh2290 merged commit 5b63144 into apache:master Jul 12, 2018
@haojin2
Copy link
Contributor

haojin2 commented Jul 17, 2018

This should fix #11339

XinYao1994 pushed a commit to XinYao1994/incubator-mxnet that referenced this pull request Aug 29, 2018
* Fix build issue with CUDNN=0

* Fix nocudnn func name

* Remove python2 tests

* Remove CPP package test

* Check assert raises when cudnn disabled for op tests on gpu

* Add line

* Remove whitespace

* add decorator for other ops

* Add and remove assert

* Fix op and common

* Fix merge issue

* Remove C API

* Fix

* Fix lint

* Add init git

* Rename CUDNN_DISABLED env variable

* Add a runtime function for nocudnn

* Remove MXCudnnIsenabled

* Add comment for disabled test

* Add full link in comment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants