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

Complimentary gluon DataLoader improvements #13606

Merged
merged 5 commits into from
Dec 14, 2018

Conversation

zhreshold
Copy link
Member

Description

This PR provides complimentary improvements for user to customize DataLoader in various use cases for optimal performance.

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • 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:https://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

@zhreshold zhreshold requested a review from szha as a code owner December 11, 2018 01:37
@roywei
Copy link
Member

roywei commented Dec 12, 2018

@mxnet-label-bot add[Data-loading, pr-awaiting-review]

@marcoabreu marcoabreu added Data-loading pr-awaiting-review PR is waiting for code review labels Dec 12, 2018
dmlc::SetEnv("OMP_NUM_THREADS", 1);
// Conservative thread management for multiprocess workers
const size_t mp_worker_threads = dmlc::GetEnv("MXNET_MP_WORKER_NTHREADS", 1);
const size_t mp_omp_threads = dmlc::GetEnv("MXNET_MP_OMP_NUM_THREADS", 1);
Copy link
Member

Choose a reason for hiding this comment

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

libgomp doesnt play well with fork: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52303 . Which means user using libgomp and increasing the num threads can run into a deadlock.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see, do you suggest completely turn off omp in worker process regardless?

Copy link
Member

@anirudh2290 anirudh2290 Dec 12, 2018

Choose a reason for hiding this comment

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

yes we should stick with the existing behavior which is turn off omp in worker regardless.
The alternative is to enforce MXNet users to use llvm openmp but that is a bigger discussion.

Copy link
Contributor

Choose a reason for hiding this comment

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

@anirudh2290 Did we really encounter this kind of deadlock? Any case to analyze?
We are looking at this issue and only using 1 thread in the worker is not very efficient.

@YutingZhang
Copy link
Contributor

@zhreshold Thank you! When is it going to be merged?

@zhreshold
Copy link
Member Author

@szha @eric-haibin-lin for review/merge

@anirudh2290 anirudh2290 merged commit b9b038f into apache:master Dec 14, 2018
zhreshold added a commit that referenced this pull request Dec 14, 2018
* init

* add tests

* doc

* lint

* fix openmp
@YutingZhang
Copy link
Contributor

YutingZhang commented Dec 15, 2018

Is it included the mxnet-cu90mkl --pre already?

@leezu
Copy link
Contributor

leezu commented Dec 16, 2018

@YutingZhang you can check the latest published file here https://pypi.org/project/mxnet-cu90mkl/#history If the build date is after the merge date, it is included

@YutingZhang
Copy link
Contributor

@leezu Yes. I had been using it over the weekend :)

mseth10 pushed a commit to mseth10/incubator-mxnet that referenced this pull request Dec 18, 2018
* init

* add tests

* doc

* lint

* fix openmp
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Data-loading pr-awaiting-review PR is waiting for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants