You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/12/11 00:10:05 UTC
[GitHub] [incubator-mxnet] cjolivier01 opened a new pull request #17039: Fix
omp assert issue
cjolivier01 opened a new pull request #17039: Fix omp assert issue
URL: https://github.com/apache/incubator-mxnet/pull/17039
## Description ##
Fix for: https://github.com/apache/incubator-mxnet/issues/14979
## 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](https://issues.apache.org/jira/projects/MXNET/issues) created (except PRs with tiny changes)
- [ X] Changes are complete (i.e. I finished coding on this PR)
- [X ] 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)
- [ X] 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
- [X ] To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
## Comments ##
* When forking, sometimes mxnet can hook its fork handler before openmp's, depending upon static startup order as well as variables such as whether OMP_NUM_THREADS is set. This is mitigated by forcing an OMP call before mxnet hooks a fork handler as well as first-thing after forking as the child. This avoids two scenarios:
1) An OMP API call by mxnet before openmp's child fork handler has run, reinitializing its state to the new process
2) Starting a thread which may call an OpenMP API call (or open a parallel region) before or **during** OMP library's child fork handler.
* A considerable amount of multithreading is done by mxnext both during static init as ell as in atfork() handlers, and we may wish to change this over time. Due to the non-deterministic startup order of static init (and thus sometimes fork handling), it can cause unpredictable results.
* Build omp in release mode to stop harmless assert. Comment notes that assert is harmless and represents a variable that fails to get set to null in their atfork_child handler (they set other similar variables to to null). The variable is set to NULL in the next line of code.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services