Skip to content

Fix OMP_NUM_THREADS setting #235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2018

Conversation

muupan
Copy link
Member

@muupan muupan commented Feb 14, 2018

  • Move os.environ['OMP_NUM_THREADS'] = '1' before import chainer to make it work
  • Add it to async examples under examples/gym.

It should be before import chainer to have an effect.
@muupan
Copy link
Member Author

muupan commented Feb 14, 2018

Current master

$ time python examples/ale/train_a3c_ale.py 4 breakout --steps 1000
...
real    0m16.618s
user    0m28.334s
sys     1m28.136s

This PR

$ time python examples/ale/train_a3c_ale.py 4 breakout --steps 1000
...
real    0m5.907s
user    0m19.049s
sys     0m0.275s

Numpy config

python -c "import numpy; numpy.__config__.show()"
blas_mkl_info:
  NOT AVAILABLE
blis_info:
  NOT AVAILABLE
openblas_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/local/lib']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
blas_opt_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/local/lib']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
lapack_mkl_info:
  NOT AVAILABLE
openblas_lapack_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/local/lib']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
lapack_opt_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/local/lib']
    language = c
    define_macros = [('HAVE_CBLAS', None)]

Copy link
Member

@toslunar toslunar left a comment

Choose a reason for hiding this comment

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

LGTM

@toslunar toslunar merged commit 4b051a4 into chainer:master Feb 14, 2018
@muupan muupan added the example label Jul 23, 2018
@muupan muupan added this to the v0.4 milestone Jul 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants