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

USE_JEMALLOC=OFF by default #17324

Merged
merged 2 commits into from
Jan 20, 2020
Merged

USE_JEMALLOC=OFF by default #17324

merged 2 commits into from
Jan 20, 2020

Conversation

leezu
Copy link
Contributor

@leezu leezu commented Jan 15, 2020

Description

As of jemalloc 5, jemalloc default build can not be used in libraries that are dlopened. However, libmxnet.so is dlopened by Python (ctypes). To use MXNet with jemalloc 5, users must not to system libjemalloc.so but must rather link to a libjemalloc compiled with special parameters to allow dlopen to work.

jemalloc 5 is distributed as part of Ubuntu 18.10 and higher, as well as Debian Stable. Users on these systems will be unable to compile MXNet with USE_JEMALLOC=ON.

An alternative is to build jemalloc as part of our build. See #17121 for an implementation. Given the lack of review of #17121 and the reliance of a patched jemalloc version to allow integration into our build, let's first proceed with the current PR.

Changes

  • Change USE_JEMALLOC default to OFF

As of jemalloc 5, jemalloc default build can not be used in libraries that are dlopened. However, libmxnet.so is dlopened by Python (ctypes). To use MXNet with jemalloc 5, users must not to system libjemalloc.so but must rather link to a libjemalloc compiled with special parameters to allow dlopen to work.

jemalloc 5 is distributed as part of Ubuntu 18.10 and higher, as well as Debian Stable. Users on these systems will be unable to compile MXNet with USE_JEMALLOC=ON.
@leezu leezu requested a review from szha as a code owner January 15, 2020 12:26
@leezu leezu added the pr-awaiting-review PR is waiting for code review label Jan 16, 2020
@ChaiBapchya
Copy link
Contributor

Should this be brought to the notice of dev community? I remember when certain build flag (MKLDNN/Large tensor) is to be toggled, it's discussed first.

On other side, since this one toggles it off so I guess we can go ahead..

@leezu
Copy link
Contributor Author

leezu commented Jan 19, 2020

Thanks, I will send a mail to dev.

@leezu leezu merged commit 425319c into master Jan 20, 2020
@leezu leezu deleted the leezu-patch-1 branch January 20, 2020 19:56
szhengac pushed a commit to szhengac/mxnet that referenced this pull request Jan 21, 2020
apache#17324)

As of jemalloc 5, jemalloc default build can not be used in libraries that are dlopened. However, libmxnet.so is dlopened by Python (ctypes). To use MXNet with jemalloc 5, users must not link to system libjemalloc.so but must rather link to a libjemalloc compiled with DISABLE_INITIAL_EXEC_TLS
szhengac pushed a commit to szhengac/mxnet that referenced this pull request Jan 21, 2020
apache#17324)

As of jemalloc 5, jemalloc default build can not be used in libraries that are dlopened. However, libmxnet.so is dlopened by Python (ctypes). To use MXNet with jemalloc 5, users must not link to system libjemalloc.so but must rather link to a libjemalloc compiled with DISABLE_INITIAL_EXEC_TLS
szhengac pushed a commit to szhengac/mxnet that referenced this pull request Jan 21, 2020
apache#17324)

As of jemalloc 5, jemalloc default build can not be used in libraries that are dlopened. However, libmxnet.so is dlopened by Python (ctypes). To use MXNet with jemalloc 5, users must not link to system libjemalloc.so but must rather link to a libjemalloc compiled with DISABLE_INITIAL_EXEC_TLS
szhengac pushed a commit to szhengac/mxnet that referenced this pull request Jan 21, 2020
apache#17324)

As of jemalloc 5, jemalloc default build can not be used in libraries that are dlopened. However, libmxnet.so is dlopened by Python (ctypes). To use MXNet with jemalloc 5, users must not link to system libjemalloc.so but must rather link to a libjemalloc compiled with DISABLE_INITIAL_EXEC_TLS
@leezu leezu mentioned this pull request Feb 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-review PR is waiting for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants